Grace Murray Hopper, 85, a retired Navy rear admiral and a legendary pioneer computer scientist who was a co-inventor of the business language COBOL, died Jan. 1 at her home in Arlington after a heart attack.

She joined the WAVES in 1943, serving through the end of the war. During the war, she served in Bureau of Ordnance's computation project at Harvard University. In the university's basement lab, she worked on some of the earliest computer equipment built and learned to program the first large-scale digital computer, the Mark I.

After the war, she remained in the reserve, returned to university teaching and worked as computer scientist. She retired from the reserve in 1966 as a commander, but was called back to active duty the next year to run the office that standardized the Navy's computer programs and languages.

In 1973, when she was past the age to win a regular promotion, an act of Congress promoted her to captain. After reaching retirement age, she remained in uniform on active duty on special yearly extentions, winning promotions to commodore and a special presidential promotion to rear admiral, before retiring in 1986 as the Navy's oldest-serving officer. Her retirement ceremonies were held aboard the Navy's oldest commissioned warship, the historic frigate Constitution.

At the time she retired, Navy Secretary John F. Lehman Jr. said, "She's challenged at every turn the dictates of mindless bureaucracy." Lehman, who presented her with the Defense Distinguished Service Medal, also recalled that she once "gave me a stern lecture on computers. It was the roughest wire brushing I've had since I got this job."

Adm. Hopper was described by co-workers, superiors and underlings as always brilliant and tireless and sometimes contrary and cantankerous. She ran an office in the Naval Data Automation Command on a steady diet of unfiltered cigarettes and with a clock that ran counterclockwise and symbolized some of her attitudes.

She had an extreme dislike of intellectual conventions and attitudes. She once told a reporter that "the only phrase I've ever disliked is, 'Why, we've always done it that way.' I always tell young people, go ahead and do it. You can always apologize later."

Her Navy awards included the Legion of Merit and the Meritorious Service Medal. In September 1991, she was awarded the National Medal of Technology by President Bush. In 1969, she was named computer sciences "man of the year" by the Data Processing Management Association. She was a fellow of the Institute of Electrical and Electronics Engineers and a member of numerous other professional groups.

Adm. Hopper, a New York native, was a 1928 graduate of Vassar College, where she was elected to Phi Beta Kappa and received a degree in mathematics and physics. She received master's and doctoral degrees in mathematics from Yale University. She taught at Vassar from 1931 until entering the Navy.

After the war, she was an engineering sciences research fellow and continued work for the Navy on the Mark II and Mark III computers. In 1949, she joined the Eckert-Mauchly Computer Corp. in Philadelphia as a senior mathematician. That company was building what became the legendary Univac I, the first commercial, large-scale electronic computing machine. The company later became part of the Remington Rand Corp., and finally, the Sperry Corp., and she was promoted to staff scientist.

At Sperry, she worked on the idea that led to COBOL, an acronym taken from "common business-oriented language." COBOL was one of the first widely used programming languages, and it helped transform computers from an exotic tool of academia and the military to a useful everyday tool of business.

Her work also led to early, successful compilers, programs that translate human instructions into the codes used by modern computers. A research team she led also was credited with coining the word "bug" to describe the computer glitches. The first "bug" was literally that, a two-inch moth that was pulled from the circuits of Harvard's Mark I in 1945.

Adm. Hopper taught at George Washington University in the 1970s. Since 1986, she had been a full-time senior consultant to Digital Equipment Corp., working out of its Washington offices.

Her marriage to Vincent Foster Hopper ended in divorce.

Survivors include a brother, Dr. Robert F. Murray II of Wolfeboro, N.H., and a sister, Mary Murray Westcote of Glen Ridge, N.J.