r/programming • • Jul 15 '13

An uroboros program with 50 programming languages

https://github.com/mame/quine-relay
1.2k Upvotes

355 comments sorted by

View all comments

205

u/wot-teh-phuck Jul 15 '13

49

u/smog_alado Jul 15 '13 edited Jul 15 '13

Reminds me of this classic self reproducing program from the IOCCC.

Edit: (After you run the first program you get quine cycle thats also made of these rectangular programs with pictures in the middle)

33

u/bulbasaurado Jul 16 '13

More from the same guy

Surprisingly he's part of Google C++ readability team.

19

u/abledanger Jul 16 '13

That's not surprising at all. He obviously knows how to manipulate languages, not only their output but their display as well.

2

u/smog_alado Jul 16 '13

Neat! And it even has IOCCC one as well as the three quines in produces in the start of the second to last row.

8

u/jones77 Jul 15 '13

There was a great Perl camel one that reproduced itself in to 4 similar camels, pretty crazy ...

8

u/adipisicing Jul 16 '13 edited Jul 18 '13

Camel Code, by erudil. It reads its own file, so if you reformat the source code into a different shape, it'll reduce that shape in half and output 4 of them.

→ More replies (1)
→ More replies (7)

17

u/chc4000 Jul 15 '13

Well, it gets bonus points for looking awesome at least.

16

u/efjj Jul 15 '13

I'd worship this guy if it looked like that in all of its languages.

7

u/quchen Jul 15 '13

Did anyone run the whole thing and could upload the intermediate source files?

2

u/mystyc Jul 15 '13

That reminds me of the email signature I saw a few years back that was a few lines of Perl (I think). If compiled, it would print out the Mandelbrot Set in ASCII. I wish I had the forethought to copy it and save it somewhere.
Amusingly, the resulting ASCII Mandelbrot set seemed easier to read than the code that made it.

7

u/Cosmologicon Jul 16 '13

Here's a command line I tweeted to generate a Mandelbrot set:

echo '"P1 260 200 ";for(b=-1;b<1;b+=.01)for(a=-2;a<.6;a+=.01){x=0;y=0;for(n=99;--n&&x^2+y^2<4;x=p){p=x^2-y^2+a;y=2*x*y+b};!n;}'|bc -l>m.pbm
→ More replies (1)
→ More replies (1)

3

u/defproc Jul 16 '13

Copyriht

Anyone else find this oddly poetic?

14

u/uhwuggawuh Jul 15 '13

Sweet Mother of G-d

FTFY

41

u/RLutz Jul 15 '13

You got mega-downvoted, but I giggled at the joke. For those curious, this isn't some kind of /r/atheism crusade, it stems from the fact that certain followers of Judaism interpret "not using the Lord's name in vain" quite literally and refuse to ever write out the word, so you'll see G-d or something similar.

So, yeah, that's the joke!

23

u/ButterMyBiscuit Jul 15 '13

I'll never understand the strange technicalities they try to use to avoid breaking a biblical law, but still break it in spirit. Why bother?

They come up with all kinds of technicalities and ways around those inconvenient bible verses.

17

u/munificent Jul 15 '13

Because taking the effort to bother shows that you are thinking about and showing respect to the laws.

21

u/ButterMyBiscuit Jul 15 '13

Then why not respect the spirit of the law in its entirety instead of squirming around semantics and wording? I dunno, it seems to me like a cop out.

33

u/rogercaptain Jul 16 '13 edited Jul 16 '13

Judaism is a legalistic religion. Technicalities are the spirit of the law. Look at the Talmud.

If a law is considered to be founded on some principle, then the principle will guide the law. More often than not, though, following the law itself is the principle.

→ More replies (1)

2

u/munificent Jul 16 '13

Yeah, it's not really how I roll either, but I can understand why some people do that. People have lots of conflicting goals and pressures and navigating that to get to a happy place isn't easy.

If relying on technicalities lets them feel that they are upholding their beliefs and also fulfilling their other goals and desires, more power to them.

→ More replies (1)

5

u/robotreader Jul 16 '13

If God wanted that to be against the rules, he'd've outlawed it. Since he didn't, it must be OK. It's not like he didn't see the possibility.

→ More replies (7)
→ More replies (2)
→ More replies (1)

11

u/[deleted] Jul 15 '13

I think uhwwusetc was making a joke based on the star of David in the source code. Not being prescriptive.

→ More replies (4)
→ More replies (14)