4 ms·
Curiosity, not argument: Why don't you think Clojure meets those criteria? - Canonical implementation on the JVM - Borrows modern functional programming conc
by snprbob86 15y ago
Curiosity, not argument:
Why don't you think Clojure meets those criteria?
- Canonical implementation on the JVM
- Borrows modern functional programming concepts from Haskell (type classes -> protocols, immutability, etc)
- Robust concurrency constructs. While not directly copied from Erlang, designed with clear understanding-of and respect-for Erlang's successes and failures.
- Minimalist standard library
The only thing I can think of that isn't minimalist would be the reader-macros for vectors, maps, sets, lambdas, etc. However, it seems like those serve to reduce confusion & strike a decent balance between uniformity of syntax and clarify of meaning.
- spacemanaki 15y agoI'm not an expert in Scheme, Clojure, or teaching programming, but here's a few reasons why I don't think Clojure as it is TODAY would be the best language ever for learning programming (I don't really think Common Lisp is either, despite the fact that I loved Land of Lisp). - Clojure has these horribly huge Java stack traces when you hit an error. Newbies are going to run into errors frequently, and they don't know Java. Even I find this kind of frustrating when using Clojure (and I know Java), if only because it's annoying to have to scroll back just to read the error. This could change! I'm sure it will. But it's the state of Clojure today. - Modern function programming and concurrency stuff isn't really necessary for beginners. Sure, teach them purely functional programming to start out with, a la SICP, if that's your thing, but I think that Clojure's concurrency primitives (various reference types, immutable data structures) are a bit too advanced. Scheme is just ever so slightly simpler and I think that matters. Just my 2 c. I love Scheme and Clojure and Lisp, I'm just not experienced with teaching programming to total beginners, so take all this with a handful of salt. I tend to be conservative when it comes to these kinds of discussions and would be happy with new programmers using Python, because it's so much better than Java.
- chousuke 15y ago> I think that Clojure's concurrency primitives (various reference types, immutable data structures) are a bit too advanced. While newbies rarely need reference types (other than var, of course), I don't think there's anything particularly "advanced" about immutable data structures. Considering that most people learn math before they learn programming, immutable data might even be an easier concept to grasp for a complete newbie than imperative programming with mutable data is. You might think immutability is advanced but that's most likely because you learned to program with mutable things initially. As an aside, I agree that Clojure's stack traces are pretty bad, but there are tools that improve the mess quite a bit, eg. clj-stacktrace. The stacktraces might not be quite as intractable to newbies if you integrate that into the REPL.
- gtani 15y agoI would argue that it's very useful to learn about data structures and the immutable/mutable distinction upfront (hashtables vs. balanced 2-way trees vs. Bagwell 32-way HAMT vs. "exotics" like skip trees.) I dunno if CL make these as easily avail as clojure Re: Stacktraces, they have nicer formatting at least, but cutting out irrelevant parts of stack is tough. You can also set *stack-trace-depth* http://dev.clojure.org/display/design/Stacktraces http://dev.clojure.org/display/design/Stacktraces http://technomancy.us/154 http://technomancy.us/154