Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Clojure 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 . 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.



What 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.


> - 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.


>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

But since you can't arbitrarily inspect and restart any start frame, you don't really get the interactive programming experience.

On CL, for example, when you hit a runtime bug that is uncaught, you get the debugger window which shows not just the "stack trace" but the complete stack FRAMES that you can inspect. So let's say deep down you find where the error originated and the states of the variables.

You can then jump to the definition of the offending function, edit the function, recompile it, (optionally) change any variable on that stackframe, and then continue the execution by restarting specifically at that stack frame.

In this way, the feature of "modify a function while the code is running" becomes way more meaningful. The program evolves as it runs, as if it were a lifeform.


Ok, I have to admit, 2 and 3 can't be done at all in clojure, that I know of. The 4th one can be done through libraries, as I said, and the 1st one is out of the box, though. So perhaps saying that clojure does not enable interactive programming is a little bit harsh / absolute; but I agree that CL is more flexible in those regards.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: