News for hackers. Stuff that matters.
Re:Livebook: Elixir's Swiss Army Knife by heeton on Monday March 25, 2024 @02:12PM (#39819524)
Livebook / scripting from a workbook has been a huge boost for my workflow over the last few years. And in the last 6 months even more so, now I have a full editor and autocomplete with copilot for scripting (with context of all my scripts).

Playbooks at work, exploration in personal projects, 80% of my terminal use is now driven by an editor and sending snippets to the terminal.

(I know this is more common for emacs and lisp users, but never really managed to get into that workflow myself, until livebook)

My only gripe is that livebook itself doesn’t love reloading if I edit the source files directly, and I’d like to get that working.

Re:Livebook: Elixir's Swiss Army Knife by __jonas on Monday March 25, 2024 @02:27PM (#39819672)
I'd be interested in how to get a nice workflow going with livebook and a local mix project. Right now I do

   iex --sname some-name --cookie some-cookie -S mix
And then in the livebook, go to the runtime settings, select "Attached Node" and enter the name and cookie.

It seems kind of inconvenient to have to do this every time, and also I don't get any automatic hot reloading of modules in the livebook when I edit files directly, so I just end up copying files into the livebook to edit them. Maybe there is a nicer way?

Wish I could just `mix livebook.start` or something to open a livebook attached to the current mix project. Or have that be the behaviour when opening the notebook file by default.

Edit: I just saw this comment from the previous discussion: https://news.ycombinator.com/item?id=37035686

This might be what I want actually!

Re:Livebook: Elixir's Swiss Army Knife by freedomben on Monday March 25, 2024 @03:53PM (#39820578)
For vim users, check out vim-slime[1]. It's really changed my workflow! It can work for any language that uses a REPL, including bash/shell. Combined with tmux, it is an amazing and (in hindsight) obvious tool. I honestly can't imagine myself going back to not having it now.

[1]: https://github.com/jpalardy/vim-slime

Re:Livebook: Elixir's Swiss Army Knife by freedomben on Monday March 25, 2024 @03:55PM (#39820596)
Interestingly, I had a similar workflow in the past where I wanted to edit scripts with vim and have liveview reload them. I tried to ask for this and even offered to work on a PR, but they weren't interested (at the time at least, this was a couple of years ago).
Re:Livebook: Elixir's Swiss Army Knife by hugobarauna on Monday March 25, 2024 @02:28PM (#39819684)
I think this may solve live reloading in Livebook for you: https://github.com/jonatanklosko/mix_install_watcher