Frances E. Allen had intended to be a math teacher, but she was introduced to computing and got sidetracked, 45 years ago.

As a graduate student at the University of Michigan, Ms. Allen took a course in 1957 that involved programming a room-size computer to do elaborate mathematical calculations, and she was fascinated.

''It was 10 years before there was any such thing as computer science as a discipline,'' Ms. Allen said.

Raised on a dairy farm in upstate New York, the eldest of six children, in a house without electricity, plumbing or central heating, Frances Allen retired last week as a research fellow at I.B.M.'s Thomas J. Watson Laboratory.

Over the years, her vast variety of assignments included teaching Fortran, the programming language; writing intelligence analysis software for the National Security Agency; and helping design software for Blue Gene, an experimental supercomputer project that seeks to unravel the protein-folding mysteries.

Ms. Allen, 70, a leading computer scientist of her generation, has had a career spanning most of the history of computer science.

The family dairy farm in Peru, N.Y., just south of the Canadian border, had few amenities, but Ms. Allen's parents continually emphasized the importance of education. And they did splurge to buy a children's encyclopedia -- ''a huge treasure in the house,'' Ms. Allen recalled. She was an outstanding student, especially in math, a talent that led to a series of scholarships and a master's in mathematics, earned well before universities created computer science departments, let alone Ph.D. programs.

Ms. Allen was recruited by I.B.M.'s research division, and she joined the company in 1957. Her first assignment was to teach Fortran to I.B.M.'s corps of skeptical programmers. Developed by an I.B.M. team, Fortran was the first so-called high-level programming language.

In computing terms, a higher-level language enables communication with the computer that is closer to human understanding and further from the machine's natural vernacular of digital code, 1's and 0's. Fortran, for Formula Translator, allowed scientists and engineers to write programs that closely resembled the mathematical formulas they routinely used in their work.

With a little training, they could write programs themselves, allowing more people to use computers. Until then, programming was done by an elite priesthood that intimately understood the hardware quirks of the computers they worked on and hand-coded programs line by line, close to the machine in so-called assembly languages.

Initially, the programming priesthood was skeptical of Fortran. ''There was tremendous resistance,'' Ms. Allen recalled. ''They were convinced that no higher level language could possibly do as good a job as they could in assembly.''

But Fortran succeeded in generating programs that typically ran as efficiently as hand-coded programs. That feat of technological sleight-of-hand was made possible by a compiler program, the software that translates instructions written in a programming language understood by human programmers into the digital code of the machine.

The Fortran achievement left a lasting impression on Ms. Allen, who spent much of her career in the arcane but crucial field of advancing the science of making compilers more efficient.

To her, the field seemed a good place to make progress on what she saw as a fundamental challenge of programming: human communication with the computer is still too mired in the machine's plumbing.

''Programming is still way too low-level,'' she said. ''They still force the programmer to focus on the procedural details of making the machine work instead of the human intention of the problem to be solved.''

In the early 60's, Ms. Allen worked on the top-secret Stretch-Harvest computer for the National Security Agency. (The high-performance computer was indeed a ''stretch'' at the time, and its mission was to ''harvest'' intelligence from intercepted communications from spy listening posts around the world.)

When she began working on the project, the existence of the N.S.A. was a state secret. Its financing in the federal budget was part of the ''bureau of ships.'' Ms. Allen worked on the design of Alpha, a high-level programming language tailored for recognizing patterns in overseas messages, and the Alpha compiler.

The outside computer experts did none of the intelligence analysis and were not allowed to see the output of Stretch-Harvest. The printer, Ms. Allen recalled, was draped in black cloth, accessible only to the government officials. One efficiency report from the 1960's stated that in one period of 3 hours 50 minutes Stretch-Harvest scanned more than seven million messages of about 500 characters each, examining them for any of 7,000 different words or phrases of interest to the N.S.A.

The Stretch-Harvest computer labored on behalf of the intelligence agency for 14 years before being retired in 1976 when replacement parts were no longer available. ''We're not quite sure precisely what Stretch-Harvest did,'' Ms. Allen said, ''but it was really a workhorse for the agency.''

Ms. Allen advanced the understanding and practice of compiler optimization. But she was also a determined advocate for sharing I.B.M.'s innovations in her field with researchers elsewhere. In academic workshops and lectures, her ideas and enthusiasm encouraged others to tackle the problem of making compilers more efficient.

''Fran Allen's early work really set the tone for how everyone thinks about these problems,'' said Dr. Ken Kennedy, a professor at Rice University and a researcher in compiler technology. ''And she inspired other people. She inspired me.''

Much of Ms. Allen's early work was done in collaboration with Dr. John Cocke, a renowned I.B.M. computer scientist who died last month. Dr. Cocke was a wellspring of ideas, but he rarely wrote.

''John talked to people, but Fran wrote all the papers,'' said Dr. Susan Graham, a professor at the University of California at Berkeley and a compiler expert. ''She was the one who ensured that those ideas got out, and that was a real contribution.''

From 1980 through 1995, Ms. Allen headed an I.B.M. research team that worked on compiler software for so-called parallel computers. The rise of low-cost, high-performance microprocessor technology has meant that large computers have increasingly become machines in which groups of processors are lashed together in parallel. Then it is up to clever software to distribute the computing chores across the many processors on the computer.

Today, parallel computers can range from a few processors to thousands. I.B.M.'s ability to convert its traditional mainframes into microprocessor-based parallel machines eventually helped to ensure the company's survival.

The work of Ms. Allen's team contributed to the company's making that vital transition. In 1989, she became the first woman chosen as an I.B.M. fellow.

An athletic woman, compact and muscular, Ms. Allen walks with brisk determined strides, her shoulders swaying slightly. She is a mountain trekker and climber, a veteran of many expeditions in Austria, China, Tibet and elsewhere.

Climbing companions see the same characteristics on the trail that her computer research colleagues notice in the lab: enthusiasm, determination and an intense curiosity directed at all manner of subjects.

''Fran and I have spent a lot of time together, and I've never been bored,'' noted Dana Isherwood, a retired geochemist who worked at the Lawrence Livermore National Laboratory and a fellow climber.

Ms. Allen's recent work on I.B.M.'s Blue Gene project, exploring the fundamental life process of protein-folding, was another research adventure for her. ''Computer science is a field that came out of the problems we solved and the ones we are still trying to solve,'' she said. ''It's in my nature to find the frontiers.''