Rich_Morin
"Hell Is Other REPLs": How does IEx compare?
I just finished reading Hell Is Other REPLs in Colin Okay’s SAVE-LISP-OR-DIE series. It’s an interesting look at Common Lisp, with perceptive comparisons to various other languages.
The article closes with this summary, making me wonder how IEx compares to the Common Lisp REPL:
… true interactive development is programming such that
- your program never crashes
- because it enters an interactive debugger
- where you never lose program state
- unless you choose to do so
- after a thorough inspection of state
- including the call stack
- and after you have tinkered, recompiled functions, and edited objects
- and after you have tried restarting the computation
- all while the live program is running, possibly remotely.
AFAIK, IEx supports most (if not all) of this. However, I don’t feel qualified to make a detailed assessment. I’d also be interested to hear folks’ thoughts on REPL capabilities and features that the list doesn’t mention.
Would anyone like to offer some clues and/or comments?
Most Liked
crispinb
Having played with Clojure enough last year to be mildly dangerous (as I am now with Elixir!), the biggest thing which jumps out at me is more tool ergonomics than fundamentals. The Clojure REPL (similarly to other LISPS) is typically linked directly to your editor, such that you can hit a keystroke and instantly eval any changes into the running application, with output into the editor buffer (either as a transient overlay for info, or to a comment for further use). It’s hard to explain how smoothly interactive this makes the development process feel.
ityonemo
The up arrow should remember multiline input for goodness sake.
Go use Julia, and type this:
julia> function add(x, y)
x - y
end
julia> add(4, 3)
Now, go back and edit the add function to fix it. It’s straightforward.
It is not so in elixir (or python, or ruby, so we’re not alone but that is no excuse to not do better).
Also, I kind of want naked functions in the repl context. That’s probably too much to ask but it could be done by having a “IEx.Repl” module that is “imported” into the context and the def macro in the IEx scope triggers a recompilation of this module
cjbottaro
That would be so awesome. I work around it by using clipboard history/manager.
I’m super glad they recently allowed pipelining without requiring parens.
If we’re making requests, I would like a dynamic prompt. Seems easy to allow an anonymous function as a prompt, rather than an interpolated string. Use case is we have a multi-tenanted app and it would be nice to see what tenant you’re set to in the prompt:
iex(1)> Tenant.set("foo")
iex(1)[foo]> Tenant.set("bar")
iex(1)[bar]>
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








