4 ms·
I love REPLs! Both in Ruby and Elixir. And I have to say that the Elixir one is pretty slick. If you happen to try Elixir or you are curious what its REPL can
by strzibny 6y ago
I love REPLs! Both in Ruby and Elixir.
And I have to say that the Elixir one is pretty slick. If you happen to try Elixir or you are curious what its REPL can do, I wrote "8 + 1 things to get you started with the Elixir's interactive shell"[0].
[0] https://nts.strzibny.name/elixir-interactive-shell-iex/ https://nts.strzibny.name/elixir-interactive-shell-iex/
- diggan 6y agoThere seems to be a fundamental difference between "REPL"s and "REPL but more like a shell" that we continue to run into when discussing REPLs. If you take a look at the blogpost (or the video adamkl posted in this thread), you'll see that the REPL discussed works in a fundamentally different way than what Ruby and Elixir does. There is some more discussion around this whole REPL vs shell thing here too: https://twitter.com/VictorBjelkholm/status/1266069962361372673 https://twitter.com/VictorBjelkholm/status/12660699623613726... Edit: Funnily I just discovered your blogpost is titled "interactive shell" but your comment talks about REPL ;)
- regulation_d 6y agoI've read this argument several times in several places and I'm still unclear how this is substantively different than setting up whatever arbitrary state you want to work with in tests and dropping into the console from there. Super open to be enlightened, but up this point I haven't been persuaded.
- regulation_d 6y agoOk, so after RTFA I think the only thing described that I can't do in Elixir is seamlessly move state from the REPL to the code. The utility of that for me doesn't feel huge. Yes, I will copy and paste a line from the console to the test or the code, but (a) I don't think that's really slowing me down a ton and (b) it gives an opportunity to ensure that the thing I'm moving is exactly what I want.
- blain_the_train 6y agoBecause you don't just drop into the reply in tests. You can drop into the repl on a production system. Or during a live dev env. No more guessing what the input was that blew things up, your gonna do that investigation on the real patient.
- fmakunbound 6y agoYeah that's a bit primitive compared to what the guy in the video is demonstrating. He's sending arbitrary forms from source files as well as from a dedicated input area to a REPL, the forms are evaluated and the printer understands that either more Clojure forms being returned or more output.