3 ms·
Thanks for the rec. It doesn't have to be a lisp, but if I'm switching from Ruby I wanted to get something much more major in return, and the REPL features fit
by d3nj4l 5y ago
Thanks for the rec. It doesn't have to be a lisp, but if I'm switching from Ruby I wanted to get something much more major in return, and the REPL features fit the bill. The reason is that when scripting, I often need to debug and explore the problem while the script is running, and most languages don't make that easy. Ruby's debugger (and formerly, pry) is pretty useful, but a full fat REPL would make the experience far more joyful.
As for that line, maybe it's my Ruby heritage, but I didn't find it particularly unreadable! Chaining messages is pretty tight and very useful for one liners.
- klibertp 5y agoI don't think you'll find a Lisp that would be anywhere near things like IPython (which I'd consider an example of "far REPL", with context-sensitive completions, inline documentation, rich history with searching and filtering, magic commands (eg. %timeit), ability to call shell commands, ability to mix code and shell (eg. for x in range(10): !echo $x - for lack of better example), ability to load and reload modules, ability to place breakpoints & integrated debugger, etc.). Racket with xrepl enabled is nice and offers some of the features, but far from all of them. You might want to take a look at rash[1], but the project is still experimental and some parts of it are not finalized. Common Lisp implementations coupled with SLIME are nice, and with some utility libraries you can go a long way, but then you're basically tied to Emacs. I'm not sure about Clojure - I didn't investigate that much due to startup time making it not very well suited for my use case (that's also a reason why I ruled out Elixir, even though it's also a very nice language). Other Lisps all have REPLs, but they tend to be really bare-bones compared to more advanced implementations. I used Chicken Scheme for scripting, making use of its ability to compile to native executables, and it's quite nice with a lot of eggs (packages) available, but the REPL is also pretty standard, with just the default readline functionality. > maybe it's my Ruby heritage Definitely :-) My Python-only colleagues screamed in horror after seeing that line... [1] https://rash-lang.org/ https://rash-lang.org/ - I have a similar project running on GNU Smalltalk, but didn't get to work on it in half a year :(
- d3nj4l 5y agoThanks for the incredibly detailed response! I should probably consider ironpython too, though I’m not particularly fond of Python myself. But for now, as others in this thread have pointed out, I’ll try babashka :)