Slashdot Mirror


Quadrilingual Crazy Programming

mtve writes: "Have you ever seen source code that is valid on four languages: Perl, C, Befunge, and BrainF*ck? During last Perlgolf season famous Perl hacker Jérôme Quelin submit such inconceivable masterpiece and now he published expanded explanation of his solution. Caution: that text can hurt your mental health. Play Perlgolf!"

11 of 194 comments (clear)

  1. "Polyglot" did that 10 years ago! by Lardmonster · · Score: 4, Informative

    http://www-2.cs.cmu.edu/afs/cs/user/chogan/Web/pol yglot

    Cobol, Pascal, Fortran, C, Postscript, shellscript, 8086

    --
    The more advanced the technology, the more open it is to primitive attack
    1. Re:"Polyglot" did that 10 years ago! by Anonymous Coward · · Score: 1, Informative
  2. Obligatory polyglot programming link by Anonymous Coward · · Score: 3, Informative
  3. How about 7 languages? by Zifter · · Score: 5, Informative
    What about the famous Polyglot?

    It runs/compiles under 7 languages: ANSI COBOL, ISO Pascal, ANSI Fortran, ANSI C, PostScript, Shell Script, and 8086 machine language!!! Check it out, it rocks.

    1. Re:How about 7 languages? by Internet+Ninja · · Score: 4, Informative

      The offical 'home' of polyglot is http://ideology.com.au/polyglot/.
      One of the authors was until recently my boss. While you're there have a good laugh and Corporate Hoore and Geocaching.

      BTW: polyglot has been mentioned here before.

  4. Re:Shouldn't this tell us something? by sydneyfong · · Score: 2, Informative

    Perl and PHP is different. Sure they may have that dollar sign as variables, and they have C style flow control, but that's where the similarity ends.

    PHP borrows its syntax from various other languages, including Perl, but also C, Java, Javascript, etc

    --
    Don't quote me on this.
  5. No, you're the one on drugs by yerricde · · Score: 4, Informative

    The correct term is tetralingual, not quadrilingual.

    "Quadri" comes from Latin. "Lingual" is from Latin. "Tetra" comes from Greek. In general, a compound will be all-Greek or all-Latin, with the occasional exception such as "homosexual".

    Quadrilingual is used in 1,210 pages, whereas tetralingual is used in only 14.

    I assume your Game Boy reference alluded to Tetris®. In that case, the existence of Quadra negates any "by default, go with the name of the block game" rule. In other words, you need to lay off the drugs ;-)

    --
    Will I retire or break 10K?
  6. Re:Shouldn't this tell us something? by joto · · Score: 5, Informative
    This must be some of the worst bullshit I've heard about programming languages in quite some time.

    Did you even read the article. I'll challenge you to find languages with much more different syntax from C/Perl than Befunge-98 and Brainfuck!

    There used to be PASCAL for scientists, FORTRAN for mathematicians, BASIC for hobbyists or new programmers...

    Actually, Pascal was for education, (and systems-programming (once you added some much-needed non-standard extensions)). Fortran was for scientists (mathmaticians would probably be happier with Lisp, or something like Mathematica, only scientists needs actual numbers).

    Obj C, C, and C++ are very similar

    No, they are not. Well, ObjC and C are the most similar of the three, but modern C++ has little in common with idiomatic C. Java looks very similar to Objective C (which pretty much tells you how different C and Objective C are).

    ...and most of the new 'Basic' environments like REALBasic and VisualBasic are near clones as well.

    Maybe. My experience with VB didn't leave me thinking it was anything close to Java (or any other of the above mentioned languages). However, VB.NET is supposed to be so.

    All of today's popular coding environments could be condensed to Java, Objective C, Perl, and some form of BASIC.

    Well, if by popularity, you mean lots of users, or lots of jobs available, I am very confused why Objective C is on the list (although OS X should give it a boost). On the other hand, if you mean liked by it's users, you will hardly find any language not fitting that description. By any account, you need C++ on the list.

    But yes, I agree that such a list can be made, and mine would be: C, C++, Java, VB, Perl, COBOL, PL/SQL, HTML/XML, ASP/JSP/PHP, SAS, Python, Matlab, Fortran, Common Lisp, mostly in that order, but maybe COBOL even more to the front of the list.

    Anyway, there is no way to avoid C, C++ and or Java on the top of the list. (Which maybe was your point, but anyone taking more than a cursory glance at those languages will find that they are in fact very different from each other. They look similar on the surface, but are just as different as Pascal, Fortran and Basic).

  7. ac karma whoring by Anonymous Coward · · Score: 1, Informative

    did you come up with by yourself or did you rip it from ioccc?

  8. A Brainfuck Interpreter in PHP by the_danielsan · · Score: 4, Informative

    I wrote a Brainfuck interpreter in PHP a while ago which also includes a short introduction to the language.

    By the way, Brainfuck was initially named "Mental Masturbation", but the Author Oliver Müller then stuck to a less offensive name :)

  9. Re:Wow, but slight dilemma by egreB · · Score: 2, Informative

    What Emacs mode do I use to look at the code???

    No problem, just use vi(m)! In vim, you can use several colour-coding styles in one document. Just needs a bit of tweaking, that's all.