4 ms·
It is advisable to begin with Scheme (SICP) or Racket (HtDP2) to internalize the underlying ideas behind Lisps, because in Clojure everything is messed up due
by dschiptsov 13y ago
It is advisable to begin with Scheme (SICP) or Racket (HtDP2) to internalize the underlying ideas behind Lisps, because in Clojure everything is messed up due to kitchen sink syndrome.
After proper Scheme training (CS61A) Clojure looks awkward and messy but very useful, as it supposed to be due to its "productivity beats clarity/conciseness" philosophy of scripting languages, such as Ruby.
- SCdF 13y agoFor someone who doesn't have enough hours in the day to receive "proper Scheme training" and already (sort of) knows Clojure could you go into detail about what you mean when you talk about it being "messed up due to kitchen sink syndrome."?
- coolsunglasses 13y agoHe didn't watch any of Rich Hickey's talks and thinks things like protocols multimethods are somehow kitchen-sink. OP clearly hasn't hacked on any Common Lisp written by a CLOS-maniac. Schemers break out in hives if they couldn't implement their own language on a raspberry pi in a single drunken bender.
- dschiptsov 13y agoGladly. Some languages does not emerge all of sudden as a product of one sharp mind (there is no doubts about that) but are time-selected mix of (ideally very few) basic concepts and syntactic constructs which form a well-balanced set of features. The examples of well-chosen set of basics is Scheme R4RS, or pg's Arc. The examples of so-called natural selection are CL (an attempt to put together the best ideas and syntactic sugar from various implementations) and, surprise! Haskell, which is a product of a merge of efforts of ML/Lazy languages world. On the other hand, there are languages created by one individual, according their own preferences, such as Perl, Ruby and Clojure. Ruby, for example, it is a mix of features from Perl and Smalltalk, its author liked, but, of course, the resulting language is neither a dialect of Perl or Smalltalk. It is a language of its own. Similarly, Clojure is a mix of features from various languages, notable Common Lisp, Smalltalk, ML, plus various Python-like comprehensions for vectors or hashmaps. There are many other clever tricks, like simplified pattern matching, at the cost of sacrificing uniformity and announcing vectors as parameter lists for binding constructs, apparently from ML, and multi-method function declarations, also from ML. The result is a language of its own, and cannot be called a Lisp, the same way Ruby cannot be called Smalltalk. The design decisions, while mostly clever, broke the uniformity and clarity of classic Lisps. So, in my opinion, Clojure is closer to Ruby in its ideology, than to Lisp.
- rsamvit 13y agoClojure is most definitely a Lisp. The biggest difference from more traditional lisps is that it has literals for a wider variety of data structure types. Apart from that, it has every single characteristic that defines a lisp. > After proper Scheme training (CS61A) Clojure looks awkward and messy but very useful, as it supposed to be due to its "productivity beats clarity/conciseness" philosophy of scripting languages, such as Ruby. As someone with "proper Scheme training" (CS61A), I've found that Clojure is actually much more clear than Scheme in most cases. The code is less beautiful from a purely visual perspective because there is more syntax, but a lot of complexity gets removed when you add literals for sets, vectors, and maps.
- hga 13y agoWell, I don't think it can be called a LISP, as in LISt Processing, which I pedantically use to describe the Lisps that came before it, because in addition to making those additional data structures first class syntactic citizens and their widespread use by programmers, it as dschiptsov notes modified some standard LISP syntax to use vectors where you have a list that'll never be modified, extended, etc. E.g. (defn name [arg1 arg2] body). Lists are not the alpha and omega like they are in LISPs. But I agree it has "every single characteristic that defines a lisp", even if it looks funny to experienced Lispers like myself. Aesthetically I much prefer standard LISP syntax + indentation , but 100% support the use of literals for the non-list data structures. Many disagree on the syntax, and if no longer having a sea of pure parens brings more adaptation I'm willing to live with it. I got the impression the syntax changes were due to that reason vs. inspiration from ML, but I'm not at all sure about that. Still, Rich Hickey is an experienced Lisper with exquisite taste below the level of syntax, so I'm pretty sure he was aware of the implications of his syntax changes.
- jared314 13y agoI don't understand your position on lists. In Clojure, lists, vectors, and other collections are unified under the Seq abstraction. To me, they are all the same, until I need some specific behavior or performance characteristic.
- tensor 13y agoI don't think you miss a single clojure thread with your rhetoric about "what a true lisp is." It really is rather tiring. I'd kindly ask that if you want to promote scheme or common lisp you do it by submitting relevant articles and promoting them in a positive way, rather than the very negative way you do in every single clojure thread.
- dschiptsov 13y agoYes, it could be called a promotion, if you wish, but not of Scheme, but the philosophy of being good-enough mix of very few well-selected and balanced features. The old CS61A course, of which I am huge fan, taught you the very important idea that all you need is lambda as Brian Harvey put it himself.) The meaning is quite profound. First of all, the notion that everything could be written using just procedure calls (we will not talk about Lambda Calculus here) few special forms and list notation, which goes back to John McCarthy is the great one, and Scheme, therefore, is a result of polishing this idea. Second very important idea related to the first - all the fundamental ideas and techniques in programming one should learn and internalize, could be easily and elegantly expressed in Scheme. This is why it was a language of choice for teaching CS. Even if it lacks some features, such as advanced module system or OO capabilities, but they teach you how easily it could be implemented, and that it is of second importance. So, if I am promoting something here it is these realizations from Brian Harvey, and for me Clojure is something very opposite, a mess and hype and unjustified rhetoric, claiming that it is superior to something much more great and profound. And it is not an empty pose. Even playing with its repl will teach you that it is full of special cases you must learn and know, that if something is printed as a list it might be not, that behavior of a function depends on what data-structure is given as its argument and so on. I'm also not sure that collections is such a great idea.
- tensor 13y agoNo one denies the importance of Lambda calculus, but you are confusing the notions of minimality, expressivity, and pragmatism. Worse, you can't seem to accept that others do not agree with your notion of an "ideal balance" of these things. It's perfectly fine to not like a language, but it's inappropriate to be so over the top with it as to post in, quite literally, every story about that language.