Live data from Hacker News

Elixir Livebook now as a desktop app

news.livebook.dev

41–50 of 111 posts

Re: Elixir Livebook now as a desktop app

#41

Was excited for this. However on my M1 mac, it launched once, and now it won't open. Tried killing all processes and now nothing.

Sorry about that! A bug report at https://github.com/livebook-dev/livebook/issues/new would be very appreciated, especially with relevant parts from ~/Library/Logs/Livebook.log.

Thanks for the log location - I killed the erlang process and now it works - it launched in a browser window with no app icon though?

Re: Elixir Livebook now as a desktop app

#42

This is awesome! Starting it up from the terminal and going to the url was not super convenient for quick tasks and scripts, this is much better. Edit: one thing that would make it even nicer is if it would remember the folder and/or recently opened notebooks.

Recently opened notebooks are on the roadmap. ;)

Amazing! Can't wait.

Re: Elixir Livebook now as a desktop app

#43
post #19

The Elixir ecosystem is growing incredibly well. I am impressed both from an engineering and a product perspective. It shows that they are playing the long game. I think they are achieving what I wished happen to the Clojure ecosystem: productive, well designed, respected and popular. Clojure missed the last step, unfortunately.

I agree, and I think their move into ML is a genius move that is going to make elixir mainstream. I'm super excited for the future.

I've wondered whether it's easier to add data analyst stuff to Elixir that Python seems to have, or add features to Python that Erlang (and by extension Elixir) provides out of the box.

By what I can see, if you want multiprocessing on Python in an easier way (let's say running async), you have to use something like ray core[0], then if you want multiple machines you need redis(?). Elixir/Erlang supports this out of the box.

Explorer[1] is an interesting approach, where it uses Rust via Rustler (Elixir library to call Rust code) and uses Polars as its dataframe library. I think Rustler needs to be reworked for this usecase, as it can be slow to return data. I made initial improvements which drastically improves encoding (https://github.com/elixir-nx/explorer/pull/282 and https://github.com/elixir-nx/explorer/pull/286, tldr 20+ seconds down to 3).

[0] https://github.com/ray-project/ray [1] https://github.com/elixir-nx/explorer

Re: Elixir Livebook now as a desktop app

#44

Earlier quoted context omitted.

Sorry about that! A bug report at https://github.com/livebook-dev/livebook/issues/new would be very appreciated, especially with relevant parts from ~/Library/Logs/Livebook.log.

Thanks for the log location - I killed the erlang process and now it works - it launched in a browser window with no app icon though?

Yeah there's no app icon in the Dock because we don't have any GUI besides the menu bar icon.

Re: Elixir Livebook now as a desktop app

#45
post #39

Earlier quoted context omitted.

Because of the Java ecosystem, in Clojure you are in much more advantageous position than with Elixir.

Elixir also opens you up to the entire erlang and Beam ecosystems. Not as common as Java, I know, but still decades of knowledge and tooling around it cutting across many industries.

Seems like Beam is a more specialized tool than JVM but if you need that sort of functionality it's phenomenal. With things like built-in performant persistent key value stores and cluster management I'm kind of surprised more people haven't pushed through the "this is useful but lacks broad adoption" barrier.

Re: Elixir Livebook now as a desktop app

#46
post #26

Earlier quoted context omitted.

It's used for the desktop app, as you can see here[1]. [1] https://github.com/livebook-dev/livebook/blob/355527f7e8034e...

Thanks for linking this. I was interested in how it worked but I didn't know enough elixir to get around the codebase by myself. This entry point is very informative for how they managed to do it. I just looked at the macOS part, but the tl;dr for that is they seem to have compiled the elixir program into a binary and wrote enough swift to manage the lifecycle of the elixir program and signed it and notarized it and…

No problem! The pr here[1] is also instructive, and here is the one for windows[2]. It seems similar-ish.

[1] https://github.com/livebook-dev/livebook/pull/865/files

[2] https://github.com/livebook-dev/livebook/pull/1032/files

Re: Elixir Livebook now as a desktop app

#49

Earlier quoted context omitted.

You can have a look at the code: https://GitHub.com/livebook-dev/livebook/tree/main/app_bundl...

I, too, am interested but I'm not terribly literate in elixir yet. I am aware that you can compile executables in elixir with a release command but I'd be curious to hear more about (or at least be pointed to the specific spots in the code) how the bundling was done to give you a discrete application per platform, with app icon and everything. Having a script that opens a web browser pages is simple enough, but the e…

Right, so our goal was to allow configuring the bundle with app icons etc and importantly custom URL schemes and file types [1]. And then macOS- [2] and Windows- [3] specific launchers capture the "open file" and "open url" events and trigger the Elixir side of things. Another reason for native launchers is if for any reason we couldn't start the Elixir side, we want to let the user know that something went wrong and point to logs. (We have that on Mac and will have on Windows very soon.)

[1]: https://github.com/livebook-dev/livebook/blob/920f70817efbac...

[2]: https://github.com/livebook-dev/livebook/blob/920f70817efbac...

[3]: https://github.com/livebook-dev/livebook/blob/920f70817efbac...

Re: Elixir Livebook now as a desktop app

#50

Earlier quoted context omitted.

Why would you use a notebook for quick scripts though

I often need to inspect/transform some JSON/CSV/text/whatever data, move around/organize a bunch files, and similar things. I find that notebooks work great for that as you don't need to set up an environment, you can easily collect and rerun your scripts if you do need them again, and the output options are great for debugging and looking at data.

I know this is a Livebook love-fest, but you may also consider setting up org-mode sometime. There's a lot to love about org-mode but to stay on subject, you can write your documents in a plain text syntax akin to markdown and any of the code blocks that you add in as examples are _executable_. And you can take the output from one and pipe to another.

At work, for example, we have to hit a remote API and the secrets are stored in AWS secrets manager. I have some documentation that has a block describing how to get the secrets and some other documentation elsewhere describing how to issue a post request and I can pipe the output from one block into another and receive the output either in the same file or put it somewhere else.

The one downside with this extreme flexibility is I sometimes catch myself squirreling away useful functionality in my own notes instead of adding it in a utility CLI or similar where it can be shared with the team.

If having access to a scripting language is duct tape, piping output from one script to another in this way in a single file is like having inter-dimensional duct tape.

Post reply on HN