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









