Cells are basically tiny computers: They send and receive inputs and output accordingly. If you chug a Frappuccino, your blood sugar spikes, and your pancreatic cells get the message. Output: more insulin.

But cellular computing is more than just a convenient metaphor. In the last couple of decades, biologists have been working to hack the cells’ algorithm in an effort to control their processes. They've upended nature's role as life's software engineer, incrementally editing a cell’s algorithm—its DNA—over generations. In a paper published today in Nature Biotechnology, researchers programmed human cells to obey 109 different sets of logical instructions. With further development, this could lead to cells capable of responding to specific directions or environmental cues in order to fight disease or manufacture important chemicals.

Their cells execute these instructions by using proteins called DNA recombinases, which cut, reshuffle, or fuse segments of DNA. These proteins recognize and target specific positions on a DNA strand—and the researchers figured out how to trigger their activity. Depending on whether the recombinase gets triggered, the cell may or may not produce the protein encoded in the DNA segment.

A cell could be programmed, for example, with a so-called NOT logic gate. This is one of the simplest logic instructions: Do NOT do something whenever you receive the trigger. This study's authors used this function to create cells that light up on command. Biologist Wilson Wong of Boston University, who led the research, refers to these engineered cells as “genetic circuits.”

Here's how it worked: Whenever the cell did contain a specific DNA recombinase protein, it would NOT produce a blue fluorescent protein that made it light up. But when the cell did not contain the enzyme, its instruction was DO light up. The cell could also follow much more complicated instructions, like lighting up under longer sets of conditions.

Wong says that you could use these lit up cells to diagnose diseases, by triggering them with proteins associated with a particular disease. If the cells light up after you mix them with a patient’s blood sample, that means the patient has the disease. This would be much cheaper than current methods that require expensive machinery to analyze the blood sample.

Now, don't get distracted by the shiny lights quite yet. The real point here is that the cells understand and execute directions correctly. “It’s like prototyping electronics,” says biologist Kate Adamala of the University of Minnesota, who wasn’t involved in the research. As every Maker knows, the first step to building complex Arduino circuits is teaching an LED to blink on command.

Pharmaceutical companies are teaching immune cells to be better cancer scouts using similar technology. Cancer cells have biological fingerprints, such as a specific type of protein. Juno Therapeutics, a Seattle-based company, engineers immune cells that can detect these proteins and target cancer cells specifically. If you put logic gates in those immune cells, you could program the immune cells to destroy the cancer cells in a more sophisticated and controlled way.

Programmable cells have other potential applications. Many companies use genetically modified yeast cells to produce useful chemicals. Ginkgo Bioworks, a Boston-based company, uses these yeast cells to produce fragrances, which they have sold to perfume companies. This yeast eats sugar just like brewer’s yeast, but instead of producing alcohol, it burps aromatic molecules. The yeast isn’t perfect yet: Cells tend to mutate as they divide, and after many divisions, they stop working well. Narendra Maheshri, a scientist at Ginkgo, says that you could program the yeast to self-destruct when it stops functioning properly, before they spoil a batch of high-grade cologne.

Wong’s group wasn't the first to make biological logic gates, but they’re the first to build so many with consistent success. Of the 113 circuits they built, 109 worked. “In my personal experience building genetic circuits, you’d be lucky if they worked 25 percent of the time,” Wong says. Now that they’ve gotten these basic genetic circuits to work, the next step is to make the logic gates work in different types of cells.

But it won't be easy. Cells are incredibly complicated—and DNA doesn’t have straightforward “on” and “off” switches like an electronic circuit. In Wong’s engineered cells, you "turn off" the production of a certain protein by altering the segment of DNA that encodes its instructions. It doesn't always work, because nature might have encoded some instructions in duplicate. In other words: It’s hard to debug 3 billion years of evolution.