by jgalt212 · 12y ago · 0 comments
Are they any other usable compiled languages with a REPL?
Really, IMHO, jumping back and forth between the editor and the REPL with constant reloading is a better approach than pasting things into the REPL. I remember when I was playing with Common Lisp, I would always have trouble keeping the code on disk and the code loaded into the REPL synced.
Then you're doing it wrong. Most people doesn't type directly into the REPL, they open up a separate buffer in Emacs and play in that. The REPL is just for small tests. There is no such thing as 'keeping the code synced'.
I haven't used either Distel or SLIME extensively enough to say if it's comparable, but it looks fairly similar.
Plus, most don't implement Lisp's READ EVAL PRINT LOOP, but a simpler command line interface.
What I think still sets Lisp and Smalltalk apart, is their environments at Xerox PARC.
We are still far from having back this type of live editing experience in more mainstream languages.
Take this simple example:
> (+ 1 "foo")
The value "foo" is not of the expected type NUMBER.
[Condition of type TYPE-ERROR]
Restarts:
0: [USE-VALUE] Use a new value of type NUMBER instead of "foo".
...
> 0<RET>41<RET>
=> 42
>http://www.insectnation.org/howto/problems-with-root
I was part of the team that wrote the original Open Source implementation (under GPL terms) named OpenBIOS. The project now also hosts all kinds of other implementations that were later published under BSD terms by their owners (and had 10+ years of market experience under their belt at that time).
When FORTH started out, one of its differentiators was its live environment: you could test one step (part of an algorithm or similar) at the prompt, then define a "word" (= function) that implements it using the statements you tried, repeat until you finished your program using the words you defined earlier.
Erlang and Elixir, a new language for the Erlang VM with a different syntax, are compiled languages with REPLs. I also think about Scala and others for the JVM, but I have a feeling you do not think of those as examples because of the VM or the lack of native code compilation. I could be wrong.
- Create an interpreter library for language X
- Offer a GUI/CLI application using the said library
Not all repls need to work at function level like LISP does.