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!"

6 of 194 comments (clear)

  1. Man, that is child's play. by I.T.R.A.R.K. · · Score: -1, Troll

    You call that real programming? You pussy.

    --

    "Adequacy.org: Where congenital stupidity is not an option, but a requirement."

  2. If your brain is fucked, code in 4 languages? by kiwipeso · · Score: 0, Troll

    What sort of lunatic wants code that compiles in 4 languages, anyway?
    Isn't it bad enough that microsoft creates gigabytes of code bloat, let alone all the geeks who are now going to try multi-lingual code?

    --
    - Kaos games and encryption systems developer
  3. HAHAHAAHHAHAHAHAAHAHAHAHAH by Anonymous Coward · · Score: -1, Troll

    I'M SOME CRAZY SHIT, YOU KNOW THAT?!

    o
    |
    |\
    |====||D (0)
    |UU
    |\

    Three Rings for the Elven-gimps under the whip,
    Seven for the Gaylords in their halls of fudge,
    Nine for Mortal Puffs doomed to wank men,
    One for the Dark GayLord on his dark boyfriend
    In the Land of Shitstab where the Gayness lies.
    One Ring to wank them all, One Ring to cum them,
    One Ring to stab them all and in the darkness rape them
    In the Land of Shitstab where the Gayness lies.
    He paused, and then said in a deep voice,
    "This is the Master-Knob, the One knob to wank them all.
    This is the One knob lost many years ago,
    to the great weakening of its master's power.
    Now, he greatly desires to have it up the arse again,
    - but he must NOT have it!"

  4. I concur. by I.H.O.S.W.R.K. · · Score: -1, Troll

    When I am having oral sex with retarded children, I often have trouble compiling my code quadrupally. Glad to see I am not alone!

    /*
    **
    ** I.H.O.S.W.R.K.
    **
    */

    --
    /*
    **
    ** I.H.O.S.W.R.K.
    **
    */
  5. i know it's silly... by tps12 · · Score: 0, Troll
    Okay, obviously this is just a joke. Those are all toy languages that haven't been used in production level applications.

    But think about what this means for more serious programming.

    Imagine a program that runs in C++, MySQL, and Apache. This could be a new era in cross-platform development!

    Programmers: please study this closely, and we will finally allow Linux to compete.

    --

    Karma: Good (despite my invention of the Karma: sig)
  6. where's my O'Reilly book? by WebMasterJoe · · Score: 2, Troll

    I don't know if there's an official term for it, but I often write a function in one language that writes code for another language - for example, using PHP or Perl to write javascript. I've even gone so far as to use PHP to write a SQL statement which in turn is used to determine what will go in a Javascript function that writes HTML code. The example below is rather pointless, but I have come across real situations where it is beneficial to use that many languages together.

    function hello() {
    $q = "select * from helloworld where id=1;";
    $connect = pg_pconnect("dbname=hw user=webber password=dipsh*t");
    $cursor = pg_exec($connect, $query);
    $r = pg_fetch_row($cur,0);
    echo "<script>\n";
    echo "function do_it() {\n\tdocument.write(\"".$r[0]."\");\n}\n";
    echo "</script>";
    }

    That's three "real" languages and one markup language. And if you think that was crazy, think about this - I just had to write that in HTML in a slashdot posting textbox!

    My next goal is to make the javascript write out HTML for parameters in a Java applet. And, the whole PHP page is going to be written by a C program exectuted by a cron job that was set up via a perl script (webmin!) That's eight different languages - perl -> bash (I think) -> C -> PHP -> SQL and Javascript -> HTML -> Java. Sadly, I don't think that's nearly as crazy as the quadrilingual program. I need to learn Brainf*ck.

    --
    I really hate signatures, but go to my website.