
Hidden text inside every compiled Rust program - RailsUser2014
Here is a simple rust code:<p>&#x2F;&#x2F; main.rs<p>&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;<p>struct Point {
    x: int,
    y: int,
}<p>fn main() {
    let origin = Point { x: 0i, y:  0i };
    println!(&quot;The origin is at ({}, {})&quot;, origin.x, origin.y);
}<p>&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;&#x2F;<p>Compile it using `rustc main.rs`<p>Now open the compiled `main` file in a text editor and search for this text:<p>It was from the artists and poets that the pertinent answers came, and I
know that panic would have broken loose had they been able to compare notes.
As it was, lacking their original letters, I half suspected the compiler of
having asked leading questions, or of having edited the correspondence in
corroboration of what he had latently resolved to see.....
======
pcwalton
It's an Easter egg when the runtime crashes. There was discussion of removing
it, but the size was found to be miniscule in comparison to the rest of the
runtime.

Note that the runtime will be removed entirely soon, so that text may go with
it…

~~~
knd775
I figured as much. I do like the "You've met with a terrible fate, haven't
you?" part very much.

~~~
JoshTriplett
That one seems like the right length for a runtime error. The others seem far
too large and distracting as prefaces for a runtime error.

------
baxter001
Seemingly one of 6 possible inclusions: [https://github.com/rust-
lang/rust/blob/master/src/libgreen/m...](https://github.com/rust-
lang/rust/blob/master/src/libgreen/macros.rs)

~~~
RailsUser2014
What's the point of adding that to any program?

~~~
RailsUser2014
@Steuard Fun? I neither expect a compiler to be funny nor add data I don't
know about.

~~~
coldtea
The key characteristic of a funny person is that he doesn't comparmentalize
fun ("this is serious business" vs "this is fun").

A humorous person can find something to make fun about and make people feel
better even at a funeral -- heck even on his deathbed. I think we all have
known people like that.

OSes, compilers, interpreters, editors -- all kinds of programs have had
easter eggs since way before the IBM PC. Those kind of things are inherent in
hacker culture (check the Hacker's dictionary for lots of examples).

~~~
spb
> The key characteristic of a funny person is that he doesn't comparmentalize
> fun ("this is serious business" vs "this is fun").

Actually, in my experience, that's the key characteristic of an unfunny person
desperately trying to pass: [http://www.theonion.com/articles/who-says-java-
programmers-d...](http://www.theonion.com/articles/who-says-java-programmers-
dont-have-a-sense-of-hum,10733/)

In contrast, here's somebody who _could_ compartmentalize fun:
[http://www.reddit.com/r/IAmA/comments/2birwp/jeff_bridges_he...](http://www.reddit.com/r/IAmA/comments/2birwp/jeff_bridges_here_abiding_with_you_all_ama/cj5rknb)

Also:
[https://twitter.com/stuartpb/status/508235714287259648](https://twitter.com/stuartpb/status/508235714287259648)

------
niix
This is pretty great, makes me want to write Rust more.

------
jbert
> Now open the compiled `main` file in a text editor and search for this text:

FYI, the unix utility 'strings' has this as it's raison d'etre.

------
RailsUser2014
It's a paragram from this book: H. P. Lovecraft Fiction Collection. (search
for it in google books)

~~~
Steuard
Or rather, these are all quotes from various Lovecraft short stories. (I don't
think there's anything special about one particular collection.)

~~~
mcguire
That quote is specifically from "The Call of Cthulu".[1]

[1]
[http://www.hplovecraft.com/writings/fiction/cc.aspx](http://www.hplovecraft.com/writings/fiction/cc.aspx)

------
metafex
What a beautiful way to deal with runtime errors. This makes me really want to
pick up rust again (and find a bug in the runtime :) )

------
kalleboo
Reminds me of how all HyperCard stacks ended with the Swedish phrase "Nu är
det slut..."

~~~
duskwuff
Literally "this is the end". Appeared as the content of the TAIL chunk. :)

Bonus: HyperCard 1.x used "That's all folks..."

------
RailsUser2014
Here is the commit responsible for that:

[https://github.com/rust-
lang/rust/commit/51abdee5f1ad9326713...](https://github.com/rust-
lang/rust/commit/51abdee5f1ad932671350fdd8a7911fe144d08b8)

What's the point of adding this very long text?

~~~
Someone1234
Fun? Is that not allowed anymore?

~~~
jwatte
If Rust is widely adopted, and if this commit adds a kilobyte to every
language and every library downloaded by everyone, would the fun for the
author be worth it?

~~~
4ad
Wow, a whole kilobyte! OMG.

There are many valid reasons why this should be removed, but binary size is
not one of them.

~~~
f4444
Size is certainly an important factor in embedded systems, one of the areas
there is a lot of interest in Rust.

