Interactive development in Julia compared to [Common] Lisp?

Hello Hello.

I am looking for a programming language for some R&D work in the field of Evolutionary Computation and AI.

Interactive development in Common Lisp comes very handy when you are designing algorithms or experimenting with them. You don’t need a fully fledged algorithm in the beginning, and doing experiments over and over is very convenient and nice with SLIME. You can even pause any time in your program to change functions, variables, or inspect them. All of these are very handy when you are designing a new complex algorithm.

However, CL has many other disadvantages. Like being old and lacking so many features like package manager, floating points, and tons of other stuff as seen in the new languages like Julia.

So I wanted to ask how interactive development goes in Julia and how does it compare to the Lisp family?

So far I’ve found some posts from mfiano and tamaspapp but Discourse doesn’t let me include the links…
Any hint or link is welcome.

I haven’t written a ton of common lisp, but I’d say that Julia does quite well for interactive development, and even has some tools that CL doesn’t have for making interactive re-definitions more sanely behaved.

The big one is julia’s world-age mechanism, where every method and struct has a range of worlds where it’s valid. Defining new methods or structs advances the world-age. Every time you enter a function, the world-age is fixed (unless you hit an invokelatest or eval).

When you re-define a struct or re-define a struct, we just cap the worldage on the previous method / struct, and keep the old one around so it can still be called when needed. This helps avoid a lot of the crazy traps that one can fall into when redefining functions or data in CL.

This is also how we’re able to do things like accurate type inference and de-virtualization of multiple dispatch while maintaining dynamism (and hence why Julia is so much faster than CL).


Beyond that, I’d say Julia’s REPL is mostly more advanced than the regular REPLs you find in CL, and there’s lots of great tools for interactively running and exploring in code, in concert with an active REPL or notebook.


If you miss your parentheses, and don’t like julia’s begin/end syntax, in julia 1.14 you’ll be able to use GitHub - MasonProtter/Lispy.jl · GitHub :sweat_smile: (but probably shouldn’t)

Thank you so much! Has Julia got something similar to SLIME+Emacs where you can do incremental development?

And how good are these development features available in (Neo)vim or Emacs?

As a side note for anyone else reading this, Common Lisp can be as fast as C, like Julia can be. In fact, Common Lisp could also be faster than C in some cases. However, as a big disadvantage, you have to provide type hints which are not standard nor supported across all implementations. That’s why I am looking for “modern” alternatives where the standard has taken these into account.

Julia’s VSCode extension is quite good for this, with a nice integrated REPL, highlight and evaluate, etc.

I’m an emacs user though, so I sometimes mess around with Julia Snail which aims to be like SLIME but for julia. It’s good but a little rough around the edges sometimes.

Mostly though, I just work from a REPL and don’t use many editor-side integrations. Julia-side tools like Revise.jl let me track packages or scripts and automatically update my REPL state whenever the file / package changes. It’s a very powerful tool.

For editor-side code analysis, there’s LanguageServer.jl and JETLS.jl. JETLS.jl is really really powerful (leveraging the also very useful on its own JET.jl for editor side static code analysis).


As a side note for anyone else reading this, Common Lisp can be as fast as C, like Julia can be. In fact, Common Lisp could also be faster than C in some cases. However, as a big disadvantage, you have to provide type hints which are not standard nor supported across all implementations.

Well, in some limited circumstances yes, but realistically most of the language features can’t be used when you’re writing this ‘fast’ sub-dialect of common lisp. E.g. the CLOS is mostly out, very limited custom types, no multiple dispatch, almost all interactive features are gone, etc.


Edit: sorry @farooqkz, I should have opened my first response by welcoming you to the forum by the way. Always nice to see new people around, especially those with familiarity from the lisp world.

I think a lot of julia’s best ideas as a language come from lisps, so it’s always interesting to hear feedback from lispers who come and give julia a try.

Either Emacs or Neovim will be fine for me. Any starter kit or something for either of them?

About Common Lisp, yup you are right. That’s why I am looking for a “modern” language with the good traits Lisp family has got. The current codebase is 3 years old, does the job well and it is written in Rust. But the developer experience and productivity is terrible. Another good feature Julia has got is interop with different languages including Rust. So I might not need to rewrite the entire codebase in Julia in the beginning.

The helpful and insightful reply very shortly after me question is much better than those welcomes (:

Welcome!

I don’t know that you can pause at any time in Julia, even when running in the available interpreter. At least in the REPL. There are tools to set breakpoints and more traditional debugging. I believe integrated in the VS Code extension. Lisp (and Smalltalk) are I believe the gold standard in interactive development, and Julia likely best after such languages.

You may want to start out with Pluto.jl, it’s reactive, not exactly the interactive experience you’re after.

Be sure to use Revise.jl, it’s extremely good, and allows by now redefining everything I believe (e.g. structs; the last annoyance until recently for interactive work), and Tamas Papp migrated from Lisp way before it got that good, or not even sure it existed back then.

From Papp in the community here (and others):

and response to it (might be outdated, I haven’t read it in a while): not-common-lisp-to-julia.org · GitHub

Seems like a successor to (that you can already use, but also likely should not, more of a demo?):

LispSyntax.jl: A clojure-like lisp syntax for julia

In case any of this helps you interact with Lisp/Clojure or migrate (in stages):

I’m not sure how good this is, just found it:

There are more e.g. Free Clojure to Julia Converter - AI Code Translation | CodeConvert AI and Free Julia to Clojure Converter - AI Code Translation | CodeConvert AI and others: Julia to Clojure Converter - CodingFleet and outdated: GitHub - vshesh/Sexpr.jl: julia <3 clojure + macroexpansion · GitHub