HACKER Q&A
📣 avindroth

What are some well-designed REPLs?


I am designing a DSL and a REPL, and am looking for some inspiration.

CLI or embedded in editor, I don’t mind either.


  👤 denvaar Accepted Answer ✓
I don't know if it technically qualifies as a REPL[1], but I really enjoy Elixir's interactive console, IEx. What I like about it:

- Tab completion (obviously). Not only for functions/modules/bindings that are in scope, but also when you're in a string and begin typing a path, it will complete the directory names and stuff.

- You can type "h" before a module or function name to read the docs. Similarly, you can do the same with "t" to see type information.

- History of what you've executed, and also a reverse history search feature.

- Not fully "readline compatible", but some basic, standard key bindings work.

- Plenty of handy helper functions.[2]

[1] https://ferd.ca/repl-a-bit-more-and-less-than-that.html

[2] https://hexdocs.pm/iex/1.13/IEx.Helpers.html


👤 uticus
Ruby's IRB has always been nice to work with: https://github.com/ruby/irb#commands

Of course LISP is the example to look at with REPL: https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93prin...

...esp with Emacs: https://slime.common-lisp.dev/


👤 stop50
I like bpython. An extension of pythons repl