Slashdot Mirror


Esoteric Programming Languages

led_belly writes: "I came across this interesting page from the #alt.linux IRC chat room topic (irc.keystreams.com). It is an interesting read for all those who have ever been baffled by why/how some people do things. The Yahoo! Webring listing of similar topics is here."

3 of 259 comments (clear)

  1. Universal Machine in 371 Bits by Baldrson · · Score: 5, Interesting
    John Tromp has managed to out do the lot of them with his "Kolmogorov Complexity in Combinatory Logic" wherein he concludes:

    A mere 371 bits suffice to encode a universal combinator equivalent to ...(a) universal Turing machine:

    11100110010100110010110011000010001110010101110010 110
    01100101001100101100101001100101100101011100110010 100
    01101110011001100110001011010110100101011100101011 100
    10110011001010011000010001110011001010010010100101 100
    01110001011100110000100011011100110010100110010110 010
    10011001011001010111001100101000110111001100010110 110
    00110111001100101001100110010100110000100011000110 001

    Dan Brumleve has a written a combinator interpreter in Perl that may be capable of evaluating Tromp's strange machine.

  2. Re:What's wrong with Haskell? by nellardo · · Score: 5, Interesting
    I happen to think that Haskell is one of the semantically cleanest languages out there (I put Self in the same category).

    I mean really, in Haskell, "factorial" looks like this:
    fact 0 = 1
    fact n = n * fact (n - 1)

    Write that, and "fact 20" works just fine:
    Examples> fact 20
    2432902008176640000
    Examples>

    However, implementing Haskell (or Self) on a von Neumann architecture is non-trivial. Implementing an efficient compiler or interpreter is tres difficil. People get Ph. D. dissertations for that sort of thing. For someone deeply used to C, Haskell and Self are perverse.

    To wit:

    • In Haskell, nothing changes. Ever. State change is handled by creating a new state from the old one. Semantically clean, but about as far from C as you can get.
    • In Self, anything can change at any time. Yes, Virginia, you can redefine "if-then" whenever you feel like it. Change the inheritance hierarchy? No problem! Whoops! I made a cycle in the inheritance hierarchy! No problem! (yes, A can inherit from B and B can inherit from A). Think of C without the reliability that any particular operation (function call, operator, whatever) maps to the same place more than once. This kind of thing gives most C-family compilers hives. It used to be that C++ was perceived as significantly slower than C - I don't see anyone complaining about it anymore, but Haskell and Self are more extreme examples. C++ made it easy to use jump tables. Haskell makes it easy to use recursion, lazy evaluation, and a bunch of other things. Self makes it easy to use dynamic inheritance, multiple inheritance, even cyclical inheritance.
    What is most impressive about these kinds of languages is that you can build efficient implementations, without the compromises to the semantics that C (or its derivatives) entails. The fastest FFT library out there is in C, but the C code itself was generated by Haskell code (code that came up with some original optimizations along the way). The Self compiler is the root technology for Java JIT compilers (when Sun killed the Self project, all the compiler people went to work on "virtual machine" compilers). Self was able to hit 50% of the speed of optimized C while maintaining:
    • Full source-level debugging
    • Garbage collection
    • Checks for stack and integer overflow
    • and the ability to change the "class" of any object at any time (I put class in quotes because Self is an object-oriented language without classes - part of the super-simple semantics)..
    In short, there isn't anything wrong with clean linguistic semantics. But essentially every computer sold today is built around the von Neumann architecture, and non-von-Neumann semantics (like that used by Self and Haskell) are non-trivial to implement.

    --
    -----
    Klactovedestene!
  3. Re:APL by edhall · · Score: 5, Interesting

    APL was a lot more common than you might think. It was the first language to treat matrices as first-class entities, and so was popular for a time among the mathematics set. It was amazingly fast, in part due to its innovative use of lazy evaluation (e.g. if you only wanted a single column of a large matrix, it wouldn't bother computing the rest of it).

    A bit of APL lore: Back in the late 1970's, Ken Thompson (one of Unix's creators) spent a summer at UC Berkeley (an event that was rather influential in BSD's development). Just for fun, he wrote an entire APL interpreter -- in one weekend. It was a real pain to work with since it used two-letter codes instead of the APL character set, but other than some of the quad functions (various OS primitives and so on) it was complete.

    It's one of the more spectacular feats of programming I've ever heard of.

    -Ed