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

14 of 259 comments (clear)

  1. My head hurts by Alien54 · · Score: 3, Interesting
    One hallmark of Befunge programming is that all strings are reversed with respect to the IP; the following is the smallest 'Hello, World' program:
    55+".dlrow ,olleH">:#,_@
    Some folks just do not know when to quit
    --
    "It is a greater offense to steal men's labor, than their clothes"
  2. INTERCAL by jeffy124 · · Score: 2, Interesting

    I'd like to see how Intercal is actually used for anything or if it keeps up with other emerging languages. When new (and useful) languages hit the scene, it probably has to drop some features because they're used in that language. I guess maybe it's the first language with the ability to shrink from it's original set of features, unlike other languages out there today (like Java or even Perl)

    Of course, it appears very inefficint - A search for prime numbers less than 65535 took 17 hours while C can handle that in a about half a second.

    --
    The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
  3. Programming challenge by hackerhue · · Score: 4, Interesting

    As an intellectual challenge, rewrite DeCSS in any of these languages. Feel free to share your results with us.

    --

    To get something done, a committee should consist of no more than three persons, two of them absent.

  4. On a more serious note by stuccoguy · · Score: 2, Interesting

    Reminds me of all those fun hours wasted drawing cool pictures with LOGO.

  5. 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.

  6. where's Refine??? by shibut · · Score: 2, Interesting

    The oddest language from my point of view was Refine. It was a lisp based object oriented language with relatively few parentheses. Yes, you heard right, lisp and "few parentheses" mentioned in the same breath. We used it to create a prototype and it was interesting. I believe it grew out of Teitelbaum's group at Cornell (creators of the Synthesizer, which 1st year CS majors at Cornell were forced to code on way back when). Anyone else ever use it? I found it to have many of lisp's disadvantages (garbage collection, anyone?) without all the advantages. It did have a good plugin for emacs though (and forced this vi veteran to learn emacs).

  7. Re:APL by DumbSwede · · Score: 4, Interesting
    The object of your uhmmmm... affection can be found here at retrocomputing which is listed in the article.

    I find it odd how every syntax I have ever seen in a computer language looks ugly and stupid to me, until I become fluent in it, then I won't abide any change after.

  8. Yes I have by Starship+Trooper · · Score: 1, Interesting

    #!/usr/bin/perl
    ($_=HWX)and s|[IQ-Z!*B]X|EMLP VPS|and(tr@L-U@K-Z@),
    s&(V|K)&++($A=$1)&ge&&print"${_}LD\n";

    --
    Loneliness is a power that we possess to give or take away forever
  9. 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!
  10. My favorite esoteric language... by malfunct · · Score: 2, Interesting

    ...was called abuse. I don't know if my friend came up with the idea himself or got it somewhere else and implemented it himself. The interested thing about the language is that anything could be redefined including the keywords of the language. It allowed you to really obfuscate things. I wish I had that interpreter, it was quite fun.

    --

    "You can now flame me, I am full of love,"

  11. 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
  12. double backwards for loops by brer_rabbit · · Score: 2, Interesting

    while taking a programming languages & compilers class, the prof, after talking about parse trees, mentioned that we could implement double backwords for loops. A buddy and I looked at each and said, "huh? double backwards for loops?" The prof went on to describe a loop where:

    for (condition) {
    statement1
    statement2
    statement3
    }

    the condition is checked, and statement1-3 get executed. Then statement3, 2, 1 get executed followed by the condition being examined. Essentially flow runs down and then *up* the block.

    I always thought this was a kinda cool, half baked idea. Useful? No, not really, but cool nonetheless.

  13. Re:I thought *I* had it bad enough... by vague · · Score: 2, Interesting

    You obviously haven't gotten 'it' yet. Haskell is really, really neat. You've just got to learn to think it, just like you learned to 'think' Java or whatever.

    It's more abstract, so it often requires more thought from your side. But once you've gone there and explored and learned you are rewarded with a new way of viewing the world of computation and what goes on in it. Even if you never use it again, you'll at least know it's there and have a chance to understand why you do the things you do.

    But sure, it costs a few hour of pure thought before you see that light. And you don't seem to be interested in bending your mind around something different in this manner.

    Ah well. Your loss. Or mine =)

    --

    -
    Listen. Strange women lying in ponds distributing swords is no basis for a system of government.

  14. Re:What's wrong with Haskell? by tmoertel · · Score: 3, Interesting
    I happen to think that Haskell [haskell.org] is one of the semantically cleanest languages out there
    I was going to say in my earlier post that Haskell had the cleanest syntax and semantics, but I figured that regarding the latter some smart-aleck (which I suppose is now going to be me) would respond with a comment like this: Oh, really? Care to provide the clean semantics for Haskell's run-time space-consumption characteristics? At present the semantics are often best described by, "run it, and see what happens," although after a while one does develop a feel for it (which is incorrect more than one would like).

    For example, consider the expression,

    foldl1 (*) [1 .. 1000]
    which literally means
    (...((((1 * 2) * 3) * 4) * 5) ... 1000)
    and, by the way, is equivalent to your (fact 1000). Now, how much space is going to be consumed by its evaluation?

    Humans can easily see that the expression can be evaluated left to right, treating the operator (*) as strict, and, with the list defined by [1..1000] being built lazily, it is possible to evaluate the expression in constant space:

    = foldl1 (*) [1 .. 1000]
    = foldl (*) 1 [2 .. 1000]
    = foldl (*) 2 [3 .. 1000]
    = foldl (*) 6 [4 .. 1000]
    = foldl (*) 24 [4 .. 1000]
    = ...
    But is this what Haskell guarantees? Nope. An implementation might also do it like this:
    = foldl1 (*) [1 .. 1000]
    = foldl (*) 1 [2 .. 1000]
    = foldl (*) (1*2) [3 .. 1000]
    = foldl (*) ((1*2)*3) [4 .. 1000]
    = foldl (*) (((1*2)*3)*4) [5 .. 1000]
    = ...
    In this case the accumulator in foldl builds up a linear chain of thunks, which is evaluated only after the entire list is consumed.

    You and I can see that the second method is wasteful, but the language definition provides no guidance as to whether a Haskell implementation will choose the second or the more-efficient first. (In fact, GHC would until recently choose the second for this expression.)

    Don't get me wrong. Haskell is, without a doubt, my favorite language. It's what I used for my entry in this year's ICFP Programming Contest, and I consider it the best hope for a truly great mainstream functional programming language. I love Haskell. But its lack of intuitive space-consumption semantics is a serious weakness.

    And, regarding your fact example, it doesn't really show off Haskell's semantics as much as its syntax. Why not show the classic Fibonacci Series implementation, which highlights Haskell's non-strict evaluation semantics?

    fibs@(_:fibs') = 1 : 1 : zipWith (+) fibs fibs'
    Now, if that isn't a beautiful line of code, I've never seen one.
    The fastest FFT library out there is in C, but the C code itself was generated by Haskell code
    Actually, the FFTW code was generated by code written in O'Caml not Haskell.

    Cheers,
    Tom