5 ms·
A perspective on four languages (C, Common Lisp, Forth, and Haskell)
- zck 15y agoThe page is down for me, but the google cache works: http://webcache.googleusercontent.com/search?q=cache:du8rFYqBj-wJ:madhadron.com/%3Fp%3D191+http://madhadron.com/%3Fp%3D191&cd=1&hl=en&ct=clnk&gl=us&source=www.google.com http://webcache.googleusercontent.com/search?q=cache:du8rFYq...
- krat0sprakhar 15y agoIs the site down currently?
- reemrevnivek 15y agoNot down for me. The essence of the article, if you can't get it from the cache, is this chart: (sorry, can't seem to make it look Language/core style | Lambda calculus core | Machine memory core --------------------+----------------------+---------------- language as given | Haskell | C language as medium | Common Lisp | Forth I've dropped it in Pastie here: http://pastebin.com/AdJEz2Hk http://pastebin.com/AdJEz2Hk
- mmphosis 15y ago| λ calculus | machine memory ---------------------+---------------+------------------ language as given | Haskell | C ---------------------+---------------o------------------ language as medium | Common Lisp | Forth | |
- iskander 15y ago1) I have no idea what is meant here by "given" vs. "medium". 2) In my experience, the difference between C, CL, Forth and Haskell is very small compared to their distance from Prolog. 3) I wonder where APL or Smalltalk are supposed to fall on this grid. What about more "mixed" languages such as Python and Ruby?
- noahl 15y ago"Language as given" seems to mean that the language provides a level of abstraction that the programmer is not intended to break, and "language as medium" means that the language is a means of manipulating a lower-level structure, which the programmer is supposed to be aware of. That's also completely incorrect for the way people use C nowadays. You use C because you want to control the machine, and people write their code based on machine word size, caches, etc.
- iskander 15y agoAren't languages always defined in terms of some semantics or execution model? I guess I don't see why Haskell is more "given" than CL.
- derleth 15y agoI think things like the macro system and the meta-object protocol are examples of meta-linguistic hacking you can do in CL but not Haskell.
- iskander 15y agoAhh, I see, so languages "as given" are those with poor support for metaprogramming? Where would this sort of distinction place Template Haskell, MetaOcaml, or even C++ templates?
- noahl 15y agoYeah, but sometimes programmers ignore that. For instance, C is defined in terms of chunks of memory that are all the same, but the way people actually write C is by thinking of cache line sizes and disk-read chunks, which mean that all chunks of memory are not the same. The alternative is to write your programs using the model provided and trust that they will be fast enough. I think that's how Haskell is written now, but I'm not sure. In either case, though, this is a property of how the language is used rather than the language itself, at least as I understand what he means. I have no idea about the Haskell/CL thing - I don't know much about how either language is used.
- stiff 15y agoThe term "axiomatic system" is consequently misused in the article. Probably the author had a "formal system" in mind, an axiomatic system is one in which one can deduce theorems from axioms and I don't think lambda calculus is such a system. A lot of the statements in the article are so vague and imprecise, it is hard to assign any meaning to them. Just look at the fragment of the article: "Common Lisp is one answer to this question. Its core is an axiomatic system, the lambda calculus, which John McCarthy extended just enough to write an interpreter for the resulting calculus in itself." Lambda calculus is not at the core of Common Lisp or even Lisp, it was just an inspiration for Lisps model of computation. "Common Lisp augments the interpreter with other automata on the same substrate which make construction straightforwards. Though the choice of automata may vary, the essential idea of reifying the act of construction is universal." Can someone explain what is he trying to say here? You can build languages with extremely different semantics while still keeping the ideas of S-expressions, centering the language around function application and closures, for example you can choose lazy evaluation over eager evaluation and end up with a very different language. In no way is lambda calculus some immutable core of Lisp, its model of computation is much more complex and arbitrary. "Common Lisp and Haskell are built around variants of the lambda calculus. Each substrate makes certain approaches to problems natural, though neither is a natural vehicle for human thought. The brain’s adaptation to the lambda calculus is usually experienced as an epiphany." Seldom if ever has programming in Lisp or Haskell anything to do with lambda calculus, unless of course you mean in a way so vague the term loses its meaning... He then goes one to essentially describe how Haskell is referentially transparent and Common Lisp is not, but he makes it sound like it is some philosophical difference deeply rooted in the ideas behind Lisp or Haskell, while it's just a design decision where each option has specific tradeoffs. To me all this is just some "metaphysical" mumbo-jambo, the metaphor comparing programming language to an artists medium from which he starts doesn't bring any practical insight into anything - I think some people like it only because the greatest painters are widely admired by the general public, while this is rarely so even with the greatest programmers, so someone might feel his job is a little bit cooler when reading this. I do not see what real insight someone could gain from this article.
- ohyes 15y agoTotally agree with you on how difficult this is to read. Author is speaking some form of high academic CS (and it isn't obviously used correctly). "Common Lisp augments the interpreter with other automata on the same substrate which make construction straightforwards. Though the choice of automata may vary, the essential idea of reifying the act of construction is universal." Here he is basically saying that you've turned the elements of program construction into a data-structure (the s-expression). I believe automata just refers to any program in this context. (Think computability + complexity; languages executable by a computer can be described in terms of different types of automata... NFA, DFA, PDA etc). So you are making program construction into a data-structure which can be used to manipulate programs construction, or can be manipulated itself. I agree with you about the mumbo-jumbo.
- arethuza 15y agoAs Pauli said: "Not only is it not right, it's not even wrong!"
- T_S_ 15y agoHaskell is temporarily the extreme. There are other languages hovering around this same fringe such as Clean, and others which may well be beyond it like Cayenne. Instead of Cayenne I think the action in languages with dependent types is greater in Agda and maybe Epigram at the moment. I see much more happening with Haskell than with Clean right now, but maybe I need to get out (or stay in) more.
- bitwize 15y agoLisp is its own model of evaluation. It had a procedural-abstraction operator, LAMBDA, which was inspired by Church but LAMBDA didn't become a "true" lambda until the seventies with Scheme. (CL always had lexical scoping and a true lambda, because it is younger than Scheme and its designers deliberately adopted these ideas.)
- meric 15y agoI've been learning Haskell for the past few months, and it is the most expressive language I've ever looked into. (More so even than lisp, I thought anyway, but I have only spent a couple of weeks in that direction). I thought, why bother with python / ruby, save for existing libraries and tools already made? All I need is Haskell and C! This article explains it. That's right, I don't! I should go read about Forth, though. (I still use python, precisely because of existing libraries and tools.)
- deleted 15y ago[deleted]