4 ms·
>Is there a good argument against Clojure in this case? I use Common Lisp and my main argument will be that Clojure isn't an "interactive programming" language
by flavio81 6y ago
>Is there a good argument against Clojure in this case?
I use Common Lisp and my main argument will be that Clojure isn't an "interactive programming" language like Common Lisp, Smalltalk (and Pharo, Squeak, Scratch) are. And, for me, this is removing one of the main, core advantages of Lisp.
Dispensing with the interactive programming features is, IMO, a step backwards in the state-of-the-art. Common Lisp ADDED all the improvements in the state of the art: Interactive programming from Smalltalk, lexical scoping from Scheme, various high performance/low level features from StarLisp and ZetaLisp, a very powerful OOP system, etc. And then, thanks to it being highly extensive, almost any feature can be added to it.
Clojure features like threading macros, immutable seqences, software transactional memory, and others, are already available in Common Lisp by just importing (loading) the respective library.
One of Clojure's main advantage is to be able to call Java libraries. But, surprise, you can do this in Common Lisp too, easily, by using the Armed Bear Common Lisp (ABCL) implementation. Which runs on the JVM too and makes the process of calling Java libs really, really easy. I have made a working example here, calling all the Swing UI library (java) from lisp:
https://github.com/defunkydrummer/abcl-jazz https://github.com/defunkydrummer/abcl-jazz
It's true that Clojure has more widespread adoption in the industry and more libraries. However the library ecosystem on Common Lisp is decent.
>and you can get actual work done in it which is an advantage over some of the other options
This implies you can't do "actual work" in, for example, Common lisp. Which is not true, since there are companies that, in this very moment, are doing well paid, critical commercial work using Common Lisp.
- chris_j 6y agoWhat does Common Lisp have, in terms of interactive programming features, that Clojure (together with Cider and nrepl etc) lacks?
- flavio81 6y agoSee my reply above: https://news.ycombinator.com/item?id=25451321 https://news.ycombinator.com/item?id=25451321
- phyrex 6y agoI've been programming Clojure for a while and I've dabbled in CL, and while the CL debugger is certainly nicer, I don't see a major difference in how you develop interactively. Could you explain where do you see Clojure falling short?
- flavio81 6y agoSee my reply: https://news.ycombinator.com/item?id=25451321 https://news.ycombinator.com/item?id=25451321
- harperlee 6y agoClojure is quite capable in interactive programming, through its REPL, so you must be talking about the lack of a condition system in the clojure core. But Common Lisp features like the condition system are already available in Clojure by just requiring (loading) the respective library. :) As an example, see https://github.com/clojureman/special https://github.com/clojureman/special . Nice thing about this repo is that it points to other options re. conditions with pros and cons of each one. Now that I think of it, you might also be referring to the fact that Common Lisp can load libraries through the REPL. Clojure can also do this through an alpha feature, add-lib, that you can already require in any project.
- flavio81 6y agoWhat i'm talking is about the following: - Able to easily modify (and recompile) a function while your code is running - Able to redefine a class and then change existing instances so they use the new class definition - Able to sabe the complete running state of the system (the "image" of the system, including state of all variables, data, loaded libraries, compiled functions, etc) into a file so it can be restarted later, just like Smalltalk does. - Able to inspect any stack frame at will and to restart execution from any chosen stack frame These are just a few of the feature that Common Lisp has and that are part of what an "interactive language" is. Common Lisp brings all these features, they work seamlessly, without any sweat, working reliably and efficiently.
- jetti 6y ago> - Able to easily modify (and recompile) a function while your code is running I do this all the time with Clojure at work. I will have my application running (web app) with two repls in emacs. One is connected to the ClojureScript repl and one to the Clojure repl. I am able to make changes to both front end code and back end code on the fly by changing a function and then evaluating the function into the repl. I can start the application when I get in to work in the morning and have it going all day a while I'm doing my work. > Able to sabe the complete running state of the system (the "image" of the system, including state of all variables, data, loaded libraries, compiled functions, etc) into a file so it can be restarted later, just like Smalltalk does. > - Able to inspect any stack frame at will and to restart execution from any chosen stack frame Those are really cool features, are they in the base language or are they libraries that you would need to include? If I may ask, are you using Common Lisp professionally? If so, what kinds of applications do you use it for? I've had this notion, as many others seem to have in this thread, that you don't really do anything professional with CL but I realize it is just ignorance on my part.