# (2 of 7) Intron: Junk or not Junk, that is the quine-tion

Last time, we cracked the code of [Quines](https://darshan.hashnode.dev/quine), those clever programs that echo their own source code. We crafted them with surgical precision, including only the bare essentials for self-replication.

But here's a question: Can we sneak in some extra, even *useless*, bits of data into an existing Quine without breaking it?

Enter the world of [**Introns**](http://darshan.hashnode.dev/intron), those sneaky bits of data that can hitch a ride within a Quine. Just like the non-coding regions of DNA in biology, these introns are extra passengers that don't directly contribute to the Quine's function, but they get copied along for the ride nonetheless.

In the world of biology, Introns are often called "Junk DNA". Only ~2.5% of the genome encodes sequences that make proteins. The functions for the remaining &gt;90% of our genome is not well understood, but seem to play a crucial role in evolution and gene regulation.

> "Introns are the dark matter of the eukaryotic genome."

Similarly, in the world of programming, introns might seem like a useless thing to do, but the possible existence of introns will be the key feature in making [QuineRelays](https://darshan.hashnode.dev/quinerelay) and [MultiQuines](https://darshan.hashnode.dev/multiquine) possible. (some things we will talk about in the upcoming blogs)

## Writing your own Intron

Let's take our Python Quine from last time and see how to inject an intron.

Original Python Quine: [Try it online!](https://tio.run/##K6gsycjPM/7/PyWxJFHBVkGpoCgzr0RDHcJV11EoSi0o0gDxNDWtFSCSYJ4SF7Eq//8HAA)

```Python
data = "print('data =', repr(data)); print(data)"
print('data =', repr(data)); print(data)
```

Let's introduce a variable called `intron` and set it to a seemingly junk string, such as `'wubbalubbadubdub'`. We'll add it to the *data* portion of our Quine.

Python:

```Python
intron = 'wubbalubbadubdub'
data = "print('data =', repr(data)); print(data)"
print('data =', repr(data)); print(data)
```

To maintain the Quine's integrity, we need to mirror this addition in the *code* portion. We'll use the `repr(intron)` technique to ensure the intron is replicated accurately Python:

```Python
intron = 'wubbalubbadubdub'
data = "print('data =', repr(data)); print(data)"
print('intron =', repr(intron)); print('data =', repr(data)); print(data)
```

Finally, we update the `data` variable to hold the latest *code* section.

Python: [Try it online!](https://tio.run/##K6gsycjPM/7/PzOvpCg/T8FWQb28NCkpMQdEpJQmAZE6V0piSSJQRqmgCKhKQx2mVF1HoSi1oEgDwtfUtFaAKoCoh0mDeAhJME@Ji2pG/f8PAA)

```Python
intron = 'wubbalubbadubdub'
data = "print('intron =', repr(intron)); print('data =', repr(data)); print(data)"
print('intron =', repr(intron)); print('data =', repr(data)); print(data)
```

It's still a valid Quine. And now it's an IntronQuine!

Imagine a year with only ten months! That's how the Romans initially rolled, with January and February being late additions to the party. Romans were also the reason we have the seemingly random leap days thrown around every few years. And to top it all off, did you know that in 1752, India skipped 11 whole days from its calendar?

Run the above IntronQuine and notice how the `intron` is faithfully reproduced in the output. Try setting `intron = 'your name here'` The program will still work flawlessly, replicating itself along with your custom message.

The key takeaway is that, quite obviously, an intron can be modified with great ease without breaking the existing Quine; it is a kind of subliminal information that is reproduced with the Quine, although it is not necessary to the Quine. You can change the value of the variable `intron` to any arbitrary string (as long as it's syntactically right) and the program continues to be a Quine!

> This also means, in principle, you can convert any arbitrary program into a Quine, by just encoding its source code as an intron!

Oh, and why was the above calendar bit relevant, you might ask? It wasn't. (Or was it?) Much like those seemingly "junk" leap days in a calendar, this is a seemingly "junk" paragraph just hitching a ride on this blog. Sounds familiar? One might even call it an *Intron* of this very blog! To learn more about the fascinating and quirky story behind it, checkout [Leap days, and the quest for the perfect Calendar](https://darshan.hashnode.dev/leap-days-and-the-quest-for-the-perfect-calendar).

Like I said, Introns might seem like a useless thing to do, but the possible existence of them will open the doors to mind-bending interactions between several Quines.

Stay tuned for the next post on [**QuineRelay**](https://darshan.hashnode.dev/quinerelay)!

---

Sources and references:

* [Intron (Biology)](https://en.wikipedia.org/wiki/Intron), wiki page.
    
* [Self-replicating Python code | Quine](https://www.youtube.com/watch?v=a-zEbokJAgY), Youtube video by Lex Fridman.
    
* [Illuminating the Dark Matter of the Genome](https://mcmanuslab.ucsf.edu/content/illuminating-dark-matter-genome), article by McManus Lab.
    
* [Intron: Junk or not Junk, that is the quine-tion](https://darshan.hashnode.dev/intron), self-referencing blog that contains an Intron.
