shymega

shymega

What do you all think of Clojure's "REPL-driven development" method?

Hi there.

I’m from primarily Clojure, and I always liked the REPL-driven deployment method that Clojurists use, with the REPL and dynamically building applications that way.

So, further to that end, I was wondering how easy that would be with Elixir/Erlang?

Any thoughts? I love Elixir and Erlang, but I do definitely miss the Clojure way of developing applications.

Most Liked

brejoc

brejoc

I know that this discussion is pretty old, but I’d like to chime in anyway. I’ve basically just started looking into Elixir and the biggest part of my programming background is tainted by Python. But I’m also familiar with the Clojure way of doing things. One thing that I was always a bit jealous of was the REPL driven development that you could do in Clojure. While you can do a lot of things on the REPL in Python, loading a whole project with state and many classes is not something that is really possible. In the end Python is not an FP language. Once too many moving parts are involved, it get cumbersome. So most of the people do what I call pdb driven development. You run the code up to the break point and do your explorations there. When I read the comments here I though “okay, it’s similar in Elixir”. But that’s actually not true and you don’t explicitly mention it here.
So for all of the newcomers that are interested in REPL driven development: It’s working. Just not like in Clojure. In Clojure you send parts of the code from the editor the the REPL. That’s not what’s happening here. With an Elixir project you just edit your code, switch to the REPL and invoke recompile(). Now the whole code gets recompiled and you can proceed with your explorations. Also your previous state is still there. If you’ve loaded some JSON into a variable, then you can still use it. I’m really impressed by this and I think I like it even more than what Clojure is doing.

PS: Please correct me if I’m saying anything wrong. At least for my little test projects this worked so far.

tmbb

tmbb

Since nobody has said it yet, I will: REPL-driven development in clojure is a crutch. It’s needed because compiling a full clojure project is extremely slow. As a result, due to what I can only assume is Stockholm syndrome, clojure developpers start praising REPL drive development just to avoid having to compile the project in full.

mischov

mischov

There may be some truth to that statement, but that kind of hyperbole is no better than:

TDD in dynamic languages is a crutch. It’s needed because writing code in dynamic languages is extremely error prone. As a result, due to what I can only assume is Stockholm syndrome, dynamic language developers start praising TDD just to avoid losing their minds.

I personally find an exploratory style of programming that makes heavy use of the REPL beneficial and satisfying, but it’s always just one tool in the belt. Use it when it makes sense and reach for something else when it doesn’t.

Where Next?

Popular in Discussions Top

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19675 166
New
mbenatti
Following https://github.com/tbrand/which_is_the_fastest |> https://raw.githubusercontent.com/tbrand/which_is_the_fastest/master/imgs...
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
griffinbyatt
Sobelow Sobelow is a security-focused static analysis tool for the Phoenix framework. For security researchers, it is a useful tool for g...
New
jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
AstonJ
It’s been a while since we’ve had a thread like this, so what better way to kick off the year with :003: What does being an Elixir user ...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
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
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement