Rich_Morin

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

  1. your program never crashes
  2. because it enters an interactive debugger
  3. where you never lose program state
  4. unless you choose to do so
  5. after a thorough inspection of state
  6. including the call stack
  7. and after you have tinkered, recompiled functions, and edited objects
  8. and after you have tried restarting the computation
  9. 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?

First Post!

marciol

marciol

One thing I miss from Ruby is something like Ruby Pry Rescue

There is an awesome presentation, and at this point, he explains how you can use it to just catch any error and fix it dynamically, as one can do in CL.

Most Liked

crispinb

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

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

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]> 

Where Next?

Popular in Discussions Top

ricklove
I was just introduced to Elixir and Phoenix. I was told about the 2 million websocket test that was done 2 years ago. From my research, t...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
RudManusachi
What configs will make sense to put to runtime.exs? – A bit of how I configure apps: I have generic configs in config/config.exs, dev...
New
nunobernardes99
Hi there Elixir friends :vulcan_salute: In a recent task I was on, I needed to check in two dates which of them is the maximum and which...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New

Other popular topics Top

joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement