shymega
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.
Trending in Discussions
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
New
The obligatory hello world thread!
Who are you and where are you from? :stuck_out_tongue:
New
@chrismccord : I just saw the Extract AGENTS.md from Phoenix.new into phx.new generator commit to the phoenix project.
My initial shotgu...
New
I was working on an Ecto migration and I needed a timestamp. So, for the nth time, I looked up the different data types for timestamps, a...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
Is there a word for the ~> symbol used in Version strings?
Do you also just call it a Squiggle Arrow™ ?!
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
Chat & Discussions>Discussions
Latest on Elixir Forum
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
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All Posts (oldest first)
- Show All Posts (newest first)
NobbZ
Can you elaborate what that means for you? I have a REPL active virtually all the time, hot reloading my code to play with my API. Is this what you are referring to?
OvermindDL1
I’ve not used clojure, but if it is anything like lisp (since it was built like lisp) then a lisp program is not so much source code as it is a running state, and that state can change and mutate over time, and you can save out that state and reload it back in. Maybe clojure does the same? If that is what is meant then the BEAM has nothing like that. If that is not what was meant than more clarification needed. ^.^;
shymega
You’ve hit the nail on the head there. I wasn’t really quite sure how to describe what I meant, thanks!
It’s the one thing I miss from Clojure, but I suppose keeping a REPL open and reloading works well, too.
Thanks for your help, all.
peerreynders
Unlike Lisp, Clojure embraces immutability - save where mutability is necessary, like for Java interop (unless I completely misunderstood your meaning).
Now, if I’ve got my head on straight the primary impediment to “iex-driven development” is that you can’t define modules. Now keep in mind that I’m not the best person to talk about “REPL-driven development” as I’ve always found it a bit overhyped (possibly because I consider myself a lazy/slow typist). I’ve always been happy enough to kludge around with:
So with “iex-driven development” you still need two terminals open - one to edit your modules another running
iexwhere you have to manually re-compile and re-load the modified modules before you can run the updated code.Edit: I stand corrected.
michalmuskala
You can totally define modules in iex (unlike in Erlang’s shell).
NobbZ
Can you save them back? Ebin and source? Alter them easily? Meaning add a function and keep all that were already there beforehand? Delete a function?
peerreynders
I don’t recall being able to do that even in Clojure - but then again maybe I didn’t press it far enough. Basically I was just experimenting with alternate solution approaches.
This I remember doing in Clojure - essentially it felt like manipulating an in-memory representation of the code that would be run through the reader next time I executed something. In
iexI’m not sure I would know where to start … iniexI basically stick toc/2,r/1.michalmuskala
This should be definitely doable on OTP 20 with the new debug info - I mean both adding or modifying a single function.
OvermindDL1
Wrong meaning.
I mean that you can, for example, redefine a function and the new version is used from then on (old references still reference the old function, it is ‘safe’ in that way).
REPL driven development is basically you write code in the REPL, it is put in the system in real-time, any time you save you are saving a ‘dump’ of the system (no source code), and you can pick it up where it left off at any time. This was very popular in business distributing LISP since anyone could just spool up the server from the state and they could introspect the system, but no code distributed.
Easily yep, it just lacks the ability to write out the running ‘state’ of the system.
Yeah the LISP state was utter magic compared to anything else out at the time, even compared to today it is magic. ^.^
mischov
I think Elixir has quite a bit going for it REPL-wise (and I came to it from Clojure).
IEx is perfectly useful for exploration (one of the main things I used it for in Clojure), and can come close to the reloaded workflow if you’re using applications or ets to hold state. It has pretty good code reloading, though there are gotchas (like changing config)… but then there are gotchas in Clojure too.
My workflow with the REPL isn’t quite as smooth with emacs as it was in Clojure, but that’s more the result of not having spent the time to improve it than the tools being missing. I generally just
iex -S mixin a terminal and flip over to it when I want to check something. Something like Cortex would probably improve things even more.