9 ms·
Dialects of Lisp
- dschiptsov 14y agoThe way is Scheme -> Common Lisp -> Arc. Scheme comes first because it is more refined and there are excellent courses and books. CS61A probably the best introductory course. After that it is good to watch original SICP lectures by the two magicians and read the book. Then it is necessary to take a look at what HtDP team is teaching. After this there will be no trouble with Common Lisp. Classic books are these by pg and Norvig. CLtL is just a reference. Then, with all the knowledge so far one could understand arc.arc and appreciate what have been done there.) With this background you will understand what Clojure really is and why, or what is Haskell, and why there is nothing special in it. btw, there is a brilliant course by Dan Grossman on coursera covering FP. He is very clever and consistent. After this you will smile at Haskell guys.) Update: I forgot Emacs Lisp. An Introduction to Programming in Emacs Lisp is an excellent book that covers all the basic principles and gives a perspective how to use lisp in a real-world project.)
- programminggeek 14y agoWhen you say there is nothing special in it, do you mean Clojure or Haskell?
- dschiptsov 14y agoThe later.
- programminggeek 14y agoOk, thanks!
- Someone 14y ago<pedantic class='educational'> So, you mean Clojure? :-) I guess English is not your native language. http://grammar.about.com/od/words/a/latergloss.htm http://grammar.about.com/od/words/a/latergloss.htm: Use later when referring to time. Use latter when referring to the second of two persons or things mentioned previously. So, grammatically, 'the later' would refer to the language that was created later, and that's Clojure. </pedantic>
- deleted 14y ago[deleted]
- nnq 14y agoWhy do you think it would be bad to just start with Clojure as a "first Lisp"? (yeah, there's the JVM, but leiningen makes things bearable and lighttable is a one-click repl to "just start coding")
- dschiptsov 14y agoBecause, in my opinion, Clojure isn't a Lisp. It is Lisp-like language, or Java with parenthesis and immutable collections, if you wish. It violates few basic principles of Lisp - one common underlying list-structure for code and data (Clojure's code is a mix of different containers) It violates a general evaluation rule - one for every expression with a very few special forms, etc. I cannot explain it in a few sentences, I have tried few times, but I'm sure that it is better to learn the classic Lisps first, so you could be able to appreciate their elegance and simplicity (a few selected ideas put together) and then you could compare it with what you have in Clojure. It is also important to learn how Lisp programmers used to build almost everything they wish out of conses (except arrays and hash-tables, of course) how they reason about access patterns for list structures, learn simple and elegant classic functions, such as map, filter, reduce, etc in their natural environment.) It short, compared with even CL Clojure is a mess.
- pnathan 14y agoI upvoted this because I agree. I just spent about a week writing an app in Clojure, and it doesn't feel entirely like something in the Lisp Way[1]. That doesn't make it wrong, bad, immoral, etc; it is different. It has some interesting ideas which I think should be fed back into other Lispy languages via libraries (easy parallelism, immutability). [1] This is the hard to explain part.
- chc 14y agoThe idea that Lisp 1, Typed Racket, Dylan and Common Lisp are all Lisp but Clojure is not seems really weird to me. It feels like up till the '80s, Lisp was free to make progress and differences were embraced (even if that embracing was of the form "My Lisp is superior because of its differences from yours!"), but now any progress makes you "not Lisp." From people's consistent inability to articulate a meaningful distinction, I'm almost convinced that the idea of Clojure as "not really Lisp" is mostly a distaste for having reader support for vectors instead of requiring you to write (vector thing1 thing2) like most Lisps would. Yes, Clojure isn't exactly like older Lisps. Why should it be? Those Lisps are all different from each other as well. If new Lisps can't introduce new ideas, what is the point?
- Locke1689 14y agoI have no idea what you're talking about. Grossman's course is barely covering an introduction to programming languages (literally, the course my sophomore year of college covering the same material was called "introduction to programming languages"). I guess you could say that there's nothing "special" about Haskell, but the same would be true of Arc. I think Racket is the real champion in Arc -- a truly flexible programming language laboratory.
- kyllo 14y agoYeah, Grossman's course covers SML, Racket, and Ruby. Haskell is not even part of the course at all.
- dschiptsov 14y agoHis course covers the ideas behind so-called functional programming paradigm - high-order functions , environments, lexical scooping, closures and the standard idioms, including currying and lazyness. This course about concepts behind programming languages, not languages themselves.
- Locke1689 14y agoYeah. That's an introduction. You basically didn't mention anything that wasn't covered in the untyped lambda calculus at the beginning of the last century.
- dschiptsov 14y agoYeah, but that is enough for computers to work.) Inside a computer everything is a number - sometimes a number represent itself, sometimes it is a pointer (a number of a byte, an offset) and sometimes it is a code, a number of an unicode character, etc. The key idea there is that a pointer points to everything, value has a type, not a pointer. There are no pointers-to-integers along with pointers-to-booleans and pointers-to-strings. There are only numbers here. Having one kind of pointer for all is the semantics of untyped lamda calculus. We could cons everything with everything, we could have heterogeneous lists, tuples, whatever. Well, it seems that untyped lambda calculus are good-enough.) Perfection is achieved when there is nothing to remove, and not adding features is sometimes more wise.
- nnq 14y ago* sidenote: CS61A is Python based from 2011 on
- mej10 14y agoCan you expand on "or what is Haskell, and why there is nothing special in it" ?
- tikhonj 14y agoThe idea that there is nothing special about Haskell, or that Haskell is all that closely related to lisp, is patently absurd. Haskell comes from a different, more mathematical background with a much more extensive underlying theory than lisp. I actually came from the background you advocate--61A (which really was an awesome class) was my first CS course in college. (Unfortunately, they have since ruined it.) I certainly appreciate lisp and have actually used Racket in a practical setting. That said, I've found Haskell and OCaml to stand out both from purely pragmatic and theoretical considerations. Haskell is the only moderately popular language that lets you control side-effects globally. That by itself is extremely special. This makes writing maintainable code easier and gives the compiler considerable freedom in optimizing code. Haskell has an incredible but also surprisingly simple type system. You can't just ignore that. There is nothing in lisp--not even typed Racket--that even comes close to Haskell's type system. Even aside from language qualities that make Haskell special--which I haven't even come close to covering--it also stands out because of its community. Not only is the community particularly nice and welcoming, it's also special in not being afraid of a bit of math. This doesn't mean you as a programmer have to know much math, but it does mean libraries tend to be simpler and more self-consistent because they rely on very well defined mathematical abstractions with simple algebraic rules. These abstractions also allow for significantly more general code. Haskell comes from a different theoretical background and philosophy than lisp. It has different practical advantages and a very different philosophy. So claiming that it's nothing special and that you will understand all of it just coming from lisp is completely wrong.
- Locke1689 14y agoI agree with much of what you wrote there but you should remember that the single most distinguishing feature of Haskell (aside from its predecessor Miranda) is laziness. Almost everything unique you described about Haskell was not accidental, but necessary to build a wholly lazy language.
- BystanderX 14y agoFrom reading what Haskell related articles I've seen around HN and other places over the last few months, the always-on laziness seems to actually be a problem a chunk of the time, correct? Well, not so much a problem, as not always a good thing.
- brudgers 14y agoIf I were to bet, I'd place my money on Clojure as the 100 year language. It is as unbound by hardware in regard to cross platform development as any other likely candidate, it has good access to libraries meeting contemporary expectations, and is likely to continue to have access to new libraries written to meet future expectations - all due to its interaction with the JVM (and .NET). Of course I am adopting PG's premise that the 100 year language is a LISP while ignoring his premise that it is not a bit kludged up by practical considerations (i.e. the ugliness of its dependence on the JVM). (/edit) Clojure also has an evangelist in Rich Hickey whom people seem to respect independently of Clojure.
- crististm 14y agoNot bounded by hw but still bounded by its VM implementation.
- robdor 14y agoWith Clojure being available for the jvm, the clr through ClojureCLR and javascript through ClojureScript I don't believe that this will be much of an issue.
- asynchrony 14y agoExcept that ClojureScript is dependent on JVM Clojure, and if ClojureCLR were to take advantage of the CLR's capabilities (TCO and stack allocation, for example) it also wouldn't be Clojure. So we're really talking about dialects of Clojure (and perhaps might as well be talking about dialects of Lisp in general).
- swannodette 14y agoWe're not that far from officially having a boostrappable ClojureScript compiler. And some people have already done it - http://github.com/kanaka/clojurescript http://github.com/kanaka/clojurescript
- pmelendez 14y ago
- jrajav 14y agoThis answer references Chicken Scheme, which compiles to C - I'm curious, is there any work on a Scheme that compiles to LLVM? (A brief search didn't reveal anything that's been updated in the last 4-5 years.)
- fosap 14y agoyou can compile the c code to llvm IR, but why would you do that? LLVM is not a very good VM it's not platform agnostic, some stuff like the the pointer size are set a compile time, c seems to be a better platform agnostic assembler.
- chc 14y agoIt's not really a VM. It's more like a tool set for writing compilers.
- chc 14y agoPretty much all the major Schemes predate LLVM, and modifying a compiler to use LLVM instead of its existing tools is not necessarily trivial and not necessarily worth it.
- bitwize 14y agoGambit is getting backends that include x86 and JavaScript Real Soon Now. There has been LLVM work, but I don't think it progressed very far.
- mark_l_watson 14y ago+1 for mentioning Gambit-C. I don't use Gambit-C anymore, but I used to use it a fair amount for writing small utility programs. Gambit-C can be used to build very small and efficient executables. Gambit-C doesn't have the huge library that Racket or Chicken have but it is great for building small command line utilities, etc.
- Locke1689 14y agoI'm not familiar with a lot of other dialects, but the information on Racket is terrible. I wouldn't trust any of the other responses. Racket is not an R6RS scheme, it's... Racket. R6RS is an available language/library in Racket, but it's not what you usually use[1]. Racket has also always been a language laboratory, not just a scheme. I'd also wager that it's the most popular scheme used today, maybe even the most popular lisp. [1] The Racket primary language is specified with #lang Racket, R6RS is specified with #lang r6rs. R5RS is specified with #lang r5rs.
- fosap 14y agoI wonder if Arc is finished or dead. I like it it seems the ecosystem is missing.
- leke 14y agoNo mention of NewLisp?
- orthecreedence 14y agoI've seen Common Lisp start to make a great comeback in the past few years. I started programming in it seriously about a year and half ago, and since then the packaging system (quicklisp) and libraries for it are maturing very rapidly. A lot of people are making useful libraries for practical purposes. A lot of people say the language's timing was off. I couldn't agree more. However, it's starting to get a second chance. There are several open-source implementations that compile to machine code and/or support threading/networking/etc. Deployment is essentially free. For every feature that an implementation has that's not in the standard, there's a library that creates a standard, cross-implementation interface for it (for instance threading and the "bordeaux-threads" library). The language is screaming fast, extremely expressive and powerful (insert mandatory macro hype here), and becoming "standardized" all over again via its libraries. I use it (Clozure CL) in production and haven't ever had an issue.
- rayiner 14y ago> The language is screaming fast I don't disagree, but that's an interesting change in the CW.
- jdale27 14y ago(CW == conventional wisdom?) There are probably a few reasons for that. Many more programmers these days probably get their start with "scripting" languages like Python, Ruby, Perl, PHP, and JavaScript. Compared to these other dynamic, high-level languages, you probably could call Common Lisp "screaming fast". (Of course, I'm aware that there is very active implementation work going on for several of those languages that is probably doing a good deal to close the gap.) On average, though, CL is probably in the same ballpark as Java, and can sometimes be made as fast as C or C++ with a lot of effort. Also, note that Common Lisp is very much a many-implementation language (in contrast to languages like the ones above that, for most of their history, were defined by their single implementation), and different implementations make difference performance trade-offs. For much of recent history, the very high performance CL implementations have been somewhat out of reach of the typical student, hobbyist, or other weekend hacker that probably makes up most of the Lisp community. Commercial CLs are quite expensive, and high-performance free CLs like CMUCL have historically not been too friendly to beginners. When I came to Lisp, it seemed much easier to get started with CLISP (an extremely portable bytecode-compiled implementation) than with CMUCL. More recently, SBCL (an offshoot of CMUCL) and Clozure CL have made a lot of progress towards providing a go-to open source CL implementation with very good performance.
- derleth 14y agoWhy don't people do things like this for Dialects of Algol? Is it because most of them got new names, like Java, C, and so on?
- groovy2shoes 14y agoI was actually thinking about this same question earlier. There are dialects of Lisp and dialects of BASIC, but most other languages are not considered dialects of anything similar. How different do two programming languages have to be before they're no longer considered dialects? It seems like Scheme and Common Lisp, for instance, have more differences than Java and C# have from each other. Why wouldn't C# be considered a Java dialect? Visual Basic is very different from BASICA, yet they are both considered BASIC dialects. Why shouldn't Pascal and Ada be considered ALGOL dialects? The line-drawing process seems completely arbitrary.