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?

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

blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
chuck
Let me start by stating an assumption: Phoenix is a great approach to building REST APIs. There are many reasons for this, but I will ass...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 13924 124
New
IVR
Hi all, I’ve seen a number of related threads in the past, but I’d still be very curious to hear an up-to-date opinion on this topic. I...
New
New
PragTob
Hey everyone, this has been on my mind for some time and I’d love your input on it! TLDR: I feel like maps are superioer for storing and...
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
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
opsb
We’re considering our architecture from a viewpoint of scaling our traffic heavily over the next 6 months. Our current deployment is runn...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New

We're in Beta

About us Mission Statement