Berkeley CSUA MOTD:Entry 44048
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2024/12/24 [General] UID:1000 Activity:popular
12/24   

2006/8/17-19 [Computer/SW/Languages, Recreation/Humor] UID:44048 Activity:nil Cat_by:auto
8/17    http://www.madore.org/%7Edavid/programs/unlambda
        The Unlambda Programming Language. Your Functional Programming
        Language Nightmares Come True. The act of learning Unlambda is oh
        so boring and meaningless and you just want to kill yourself. In
        another word, it is like being in grad school.  -kchang
2024/12/24 [General] UID:1000 Activity:popular
12/24   

You may also be interested in these entries...
2013/4/29-5/18 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:54665 Activity:nil
4/29    Why were C and Java designed to require "break;" statements for a
        "case" section to terminate rather than falling-through to the next
        section?  99% of the time poeple want a "case" section to terminate.
        In fact some compilers issue warning if there is no "break;" statement
        in a "case" section.  Why not just design the languages to have
        termination as the default behavior, and provide a "fallthru;"
	...
2012/12/18-2013/1/24 [Computer/SW/Languages/Perl] UID:54561 Activity:nil
12/18   Happy 25th birthday Perl, and FUCK YOU Larry Wall for fucking up
        the computer science formalism that sets back compilers development
        back for at least a decade:
        http://techcrunch.com/2012/12/18/print-happy-25th-birthday-perl
        \_ I tried to learn Perl but was scared away by it.  Maybe scripting
           lanauages have to be like that in order to work well?
	...
2012/4/2-6/4 [Computer/SW/Languages/Java, Computer/SW/RevisionControl] UID:54353 Activity:nil
4/02    We use Perforce at work for revision control. It seems to work okay.
        Lately, a lot of the newer developers are saying that Perforce
        sucks and we should switch to Mercurial or Git. I have done some
        searching on the Internet and some others have this opinion. Added
        advantage is that Mercurial and Git are free. However, there would
        be some work to switch for the sysadmins and the developers.
	...
2011/4/16-7/13 [Computer/SW/Languages/Python] UID:54086 Activity:nil
4/16    Whoa, I just heard that MIT discontinued 6.001 (classic scheme)
        to 6.01. In fact, 6.00, 6.01 and 6.02 all use Python. What the
        hell? What has the world become? It's a sad sad day. SICP forever!
        \_ old story, they've ditched that shitty book and lang for a while.
        \_ I used to think scheme was cool, then I saw Ka Ping Yee's
           "Beautiful Code" class aka 61a in python, and converted.
	...
2011/4/26-7/13 [Computer/Theory, Health/Women] UID:54095 Activity:nil
4/26    Is it correct to say that Godel's work on the incompleteness thm
        proved the Principia Mathematica wrong?
        \_ It didn't exactly prove it wrong; it proved that the true goal of
           PM (a complete and consistent set of mathematical truths)
           is unattainable.  -tom
           \_ Ah cool, no this is good. See ok yeah so the main goal of PM
	...
2011/2/13-4/20 [Computer/SW/Languages/JavaScript, Computer/SW/Languages, Science/GlobalWarming] UID:54037 Activity:nil
2/13    Prototype based programming/delegation (not the pattern).  anyone
        use this at all in real world?  Does it really solve the problem of
        OOP brittleness?
	...
2011/2/24-4/20 [Computer/SW/Languages/Java] UID:54048 Activity:nil
2/24    Go Programming Language.  Anyone here use it?  It kind of
        reminds me of java-meets python, and well, that is fitting given it's
        a GOOG product.  What is so special about it?
        \_ as I understand it, it's a suitable OOP-y systems language with more
           structure than C, less complexity than C++, and less overhead than
           Java/Python.
	...
Cache (8192 bytes)
www.madore.org/%7Edavid/programs/unlambda -> www.madore.org/~david/programs/unlambda/
This page is being revised in preparation of the Unlambda 3 distribution. Introduction "It's disgusting -- it's revolting -- we love it." CyberTabloid "Unlambda, the language in which every program is an IOUCC." Encyclopaedia Internetica "The worst thing to befall us since Intercal." Computer Languages Today "The effect of reading an Unlambda program is like habing your brains smashed out by a Lisp sexp wrapped around an ENIAC. You won't find anything like it west of Alpha Centauri." The Hitch-Hacker's Guide to Programming What is Unlambda? below for links) are typically made nasty by either strongly restricting the set of allowed operations in the language, or making them very different from what programmers are used to, or both. But whereas most obfuscated programming languages try to somehow model the Turing Machine paradigm, Unlambda does not use a tape, array or stack. as a matter of fact, it does not manipulate integers in any way. Other remarkable (un)features of Unlambda are the fact that it does not have any variables, data structures or code constructs (such as loops, conditionals and such like). Rather, Unlambda uses a functional approach to programming: the only form of objects it manipulates are functions. Each function takes a function as argument and returns a function. Apart from a binary "apply" operation, Unlambda provides several builtin functions (the most important ones being the K and S combinators). User-defined functions can be created, but not saved or named, because Unlambda does not have any variables. Despite all these apparently unsurmountable limitations, Unlambda is fully Turing-equivalent. Mathematically, the core of the language can be described as an implementation of the lambda-calculus without the lambda operation, relying entirely on the K and S combinators. It uses head ("eager", "by value", "strict") evaluation. However, as far as I know, I am the first to have taken this theoretical concept and made it into an actual (deliberately obfuscated) programming language. I added a couple of functions (chosen for their obscurity) to the language so as to make output (and, in version 2, input) possible, or just to make things even more obscure (delay and call/cc are such). Clean, which are lazy and demand explicit sequencing of side effects. I dislike this terminology: for one thing, a "functional" programming language is one in which functions have first-class citizenship, so a "purely functional" one should be one where, as in Unlambda, only functions have first-class citizenship. And what are usually called "purely functional programming languages" should be called, exactly as I just did, lazily evaluating programming languages with explicitly sequenced side effects. All these points are orthogonal: it is quite possible to conceive a lazy programming language which is not functional, or an eager (ie non-lazy) functional programming language which still demands explicit sequencing of side effects. In any case, this is to say that I might, on occasion, speak of Unlambda as a "purely functional" programming language, although, with the usual terminology, it is not. Well, let's discuss an example: the following Unlambda program calculates and prints the Fibonacci numbers (as lines of asterisks) sssiiki k*ssks sksksssksskskrsksikk ksksk (All whitespace is optional and arbitrary. Writing Unlambda programs isn't really as hard as it might seem; however, reading Unlambda programs is practically impossible. explaining what all this means later on, but let's just stick to basic observations for the moment. As you can see, the most common character (essentially, it makes up half of any Unlambda program) is the backquote (ASCII number 96=0x60). After that come the S and K combinators (and I, but I can be done away with entirely). Some other characters can occur in Unlambda programs but they are not nearly so common. The more sophisticated Unlambda functions (v, d, c, e and the input functions) are not used here at all. The number one principle of the Unlambda language is that everything is a function: this is true in the sense that Unlambda is a profile of the pure untyped lambda calculus. Because there is no abstraction, functions are not named in Unlambda (except the builtin ones): there are no variables or such thing. This doesn't mean you can't build up your own functions. Nor does the fact that there are only functions in Unlambda prevent you from coming up with data structures and the like, but you just have to represent them with ad hoc functions. In fact, you can so well build your own structures and such that Unlambda is (and, to work, must be) garbage-collected like any decent high-level language. To start with, you have the builtin functions (i, k, s and the like), and you can do one thing: apply a function F to a function G, the result being denoted FG. List Sites Tutorial Although the very idea of a tutorial for such an obfuscated language as Unlambda is patently absurd, I shall try to give a brief introduction to the concepts before dwelling in the details of the reference section (which is also very short considering how small Unlambda is as a whole). introduction, the only objects that the Unlambda programming language manipulates are functions. Every function takes exactly one argument (that is also a function) and returns one value (that is also a function). The basic building blocks for Unlambda programs are the primitive functions and the application operation. Function application is designated with the backquote (ASCII number 96=0x60) character. The notation is prefix, in other words, FG means F applied to G We'll be explaining in detail what application means exactly, but for the moment, we'll just say that it means that F will do something with the value of G, including applying other functions to it, or applying it to other functions. We have to note, of course, that both F and G may themselves be obtained by applying various functions to each other. The fact that every Unlambda function is unary (takes exactly one argument) means that the backquote notation is unambiguous, and we do not need parentheses (or, if you prefer, the backquote plays the role of the open parenthesis of Lisp, but the closed parenthesis is unnecessary). For example, FGH means (F applied to G) applied to H whereas FGH means F applied to (G applied to H). To check whether an expression is a valid Unlambda expression, there is a simple criterion: start at the left with a counter equal to the number 1, and move from left to right: for every backquote encountered, increment the counter, and for every primitive function encountered, decrement it; the counter must always remain positive except at the very end when it must reach zero. Since all Unlambda functions take exactly one argument, when we wish to handle a function of several arguments, it is necessary to "curry" that function. The idea being that F will do nothing but read the first argument and return (without side effects) a function that reads the second argument and returns a function that reads the third argument and finally do whatever calculation it is F was supposed to perform. are legal, but they don't do much except wait for more arguments to come. Of course, when the user is defining his own functions, he may use whatever mechanism he seems fit for reading the functions' arguments (but such a currying is certainly the best because pairs and lists are so horribly difficult to define in Unlambda). But the builtin k and s functions take respectively 2 and 3 arguments, and the several arguments are passed in the manner which we have just described. This is what the Java version of the Unlambda interpreter does, for example (whereas the Scheme version does not). Combinators The k and s builtins are the core of the language. It takes three arguments, X, Y and Z, and evaluates as does XZYZ. So, let's get things straight: k doesn't do much until it is applied to two arguments, in which case it throws the second one away and returns the first. As for s, it doesn't do much until it is applied to three arguments, at which point it applies the first to the third,...