[HN Gopher] Livebook: A collaborative and interactive code noteb...
       ___________________________________________________________________
        
       Livebook: A collaborative and interactive code notebook for Elixir
        
       Author : bcardarella
       Score  : 420 points
       Date   : 2021-04-18 15:27 UTC (7 hours ago)
        
 (HTM) web link (dashbit.co)
 (TXT) w3m dump (dashbit.co)
        
       | namelosw wrote:
       | Wow, this is great.
       | 
       | The fact is can connect to existing nodes also makes it can also
       | be great for operation and administration - instead of building
       | an awkward admin panel, you can just having a collection of
       | scripts.
       | 
       | The Elixir community is insanely productive. Also, the Elixir
       | system is impressively pretty balanced - productivity-wise like
       | Rails, concurrent-wise like Erlang, and continuously brings novel
       | yet practical ideas to life in a robust manner!
        
       | transfire wrote:
       | All this cool Elixir news. I'm really having a hard time deciding
       | between Elixir and Julia.
       | 
       | (For programs that I must have compiled to a distributable
       | executable, I've pretty much settled on Crystal. I find it more
       | productive and pleasent than Go or Rust.)
        
         | neolog wrote:
         | https://github.com/JuliaLang/PackageCompiler.jl
        
         | dnautics wrote:
         | As someone who started on julia first and then moved to elixir:
         | 
         | If you're doing computational/numerical stuff, stick with
         | julia, for now. You really can't do that elixir, not today, and
         | maybe not for at least another year or two. It will likely
         | never be as good as julia since computation is not first class
         | in the vm it runs on.
         | 
         | If you're doing or planning or doing anything with web, or
         | orchestration, go with elixir.
        
         | thruflo22 wrote:
         | It's not quite the same story but
         | https://github.com/spawnfest/bakeware builds elixir releases
         | into distributable executables.
        
           | lobo_tuerto wrote:
           | That one is out of date, the one it forked of is not:
           | https://github.com/bake-bake-bake/bakeware
        
         | cultofmetatron wrote:
         | if you want to build a saas, go with elixir. Its got a great
         | batteries included web framework thats built to scale and an
         | emerging suit of ml and linear algebra software coming out.
         | 
         | If you want to experiment with ML and scientific programming
         | where you do a lot of matrix processing, go with julia. thats
         | literally what its made for.
        
           | neolog wrote:
           | Julia has a web framework too of course.
           | https://genieframework.com/
        
       | dnautics wrote:
       | "connect to an existing node" is going to be amazing.
       | 
       | I imagine two interesting uses for this.
       | 
       | 1. producing reports. Connect a livebook session to your system
       | in prod, run a livebook (which pulls data from DB eg), then get
       | back a report. User engagement, cloud resources consumed, p90s,
       | or an incident report...
       | 
       | 2. manual database intervention. Suppose you need to manually
       | make a batch of changes to the DB. It would be very cool if you
       | could run a livebook inside of a sandboxed checkout (a temporary
       | transaction) and write your db changes, then write your code that
       | verifies that the db is in a state that you want it to be in. If
       | you mess up your code, then you just terminate the transaction
       | without committing. Then when you're happy with your notebook,
       | you run it once with a commit at the end, and then save your
       | notebook immutably in your records so that you can keep track of
       | what you've done.
       | 
       | I think for intervening in prod, it would be very cool if someone
       | could figure out how to extend erlang distribution over
       | websockets so you don't have to figure out complicated mechanisms
       | (open up ssh port, forward encrypted epmd, e.g.) to get into your
       | system in prod
        
         | nonbirithm wrote:
         | I wish nREPL would be standardized to be non-Clojure-specific
         | as with LSP, so you could connect to a program written in any
         | language with an nREPL server and poke at it. This is basically
         | the Elixir version of that.
        
         | qbasic_forever wrote:
         | Be careful, websockets are tricky to secure and get right. It's
         | easy to do something like forget to check the origin and now
         | you've opened up a whole class of cross-site websocket
         | scripting attacks. I love the idea of easy access and nice UI
         | to prod machines, but put it behind a secure proxy or VPN layer
         | and not facing the public internet.
        
           | dnautics wrote:
           | That's very reasonable.
        
           | bcardarella wrote:
           | Phoenix Channels accounts for many of these attack vectors.
           | Livebook uses Phoenix LiveView which is built on Phoenix
           | Channels.
        
           | wrren wrote:
           | 'Connect to an existing node' is likely implemented using
           | ERTS
           | (http://erlang.org/doc/reference_manual/distributed.html). So
           | you're basically connecting to the runtime of the target
           | node. The security model for ERTS isn't great, though, so
           | your point stands. All you need is a matching secure cookie
           | and you can connect and run any commands you want.
        
             | qbasic_forever wrote:
             | Yep, and then the temptation to fix it is to roll your own
             | homebrew auth over websockets... which is super risky.
        
               | dnautics wrote:
               | I imagine that such a solution would be a public
               | package/extension with eyes on it.
        
       | out_of_protocol wrote:
       | Readable `.livemd` format looks lovely (regular markdown without
       | extra elements)
       | 
       | http://lon-screenshots.s3.amazonaws.com/2021-04-18_Screensho...
        
       | losvedir wrote:
       | I'm pretty excited about this. I'm admit I was skeptical when I
       | saw a similar LiveView based notebook a couple months ago, and
       | wondered why not just make a kernel for Jupyter.
       | 
       | But with the idea of real-time collaboration I get it. And with
       | the momentum of Jose and team behind it, I think there's real
       | promise here, especially once they figure out widgets and charts,
       | which they have an open issue for.
       | 
       | I program in Elixir at work, so I usually have an iex shell open,
       | but lately I've been using a LiveBook and it's great.
       | 
       | And I love the new Mix.install in Elixir 1.12 demonstrated here.
       | Using a hex package in an adhoc way was a real shortcoming in
       | Elixir before. Shows the power of having this thing developed by
       | the language team.
        
       | talknewswale wrote:
       | ddonaaldd ttrmp phesbuk, iNsttaagraam ko phir se kb kr paaeNge
       | istemaal? https://talknewswale.com
        
       | cancan wrote:
       | Love how prolific the elixir community and especially Jose is.
       | Also, if you are into liveview/elixir, definitely dive into the
       | codebase. There is a small operational-transform lib built in
       | there too.
        
       | CTmystery wrote:
       | Awesome work! Towards the end, Jose hits on a couple points that
       | Jupyter does not do well:                 - Minute 25: Saved
       | notebook is readable (markdown)       - Minute 23: Live
       | collaborate on a single notebook       - Minute 22: Visual
       | indication that cell is stale after an upstream cell changes
        
         | srush wrote:
         | I've been playing around with some of these ideas for Python
         | notebooks.
         | 
         | https://github.com/srush/streambook
         | 
         | This is a proof of concept that combines Jupytext for markdown
         | readable notebooks with Streamlit for in-order
         | execution+caching. More difficult to get some of the more
         | advanced features of Pluto / Livebook due to Python state
         | management.
         | 
         | Curious to hear any thoughts.
        
           | O_H_E wrote:
           | Would you be able to expand or drop a few keywords on how
           | (and what is) "python state management" prohibit few advance
           | features.
           | 
           | By in-order-execution you mean pluto's reactivity, right.
        
       | seanhandley wrote:
       | So this is like Jupyter notebooks for Elixir?
        
         | matreyes wrote:
         | If you compare the work done in both projects (github
         | insights), you will feel the power of the Beam, Elixir, Phoenix
         | and LiveView.
        
         | lawik wrote:
         | With google docs style collaborative editing, can connect to an
         | existing cluster to run code in it. You can run one instance of
         | the Livebook application and have different livebook docs run
         | for different Elixir projects you happen to be working on.
         | 
         | Not sure what parts are in Jupyter but I've heard collab
         | editing isn't.
         | 
         | Pretty hype about trying this for some living docs and
         | teaching. Will see if I can do anything neat with it. Already
         | tried it some.
        
         | rajandatta wrote:
         | Yes - it would seem so. The support for custom run times is
         | interesting and seems like an improvement. Not sure Jupyter
         | notebooks do that - certainly not for all supported kernels.
        
           | nerdponx wrote:
           | Jupyter is great but it's somewhat of a "lowest common
           | denominator". So there is always the temptation to make a
           | more task-specific version; see also the Pluto notebook
           | project for Julia and R Markdown (although the latter evolved
           | concurrently with IPython/Jupyter, not after it).
           | 
           | LSP is in a similar situation right now, where it's great for
           | languages that lacked tooling to begin with (like Python),
           | but it's not yet possible to migrate existing powerful
           | language tooling (Lisp SLIME, OCaml Merlin) to use LSP.
        
       | mstipetic wrote:
       | These guys are amazingly productive, while also running a
       | commercial company
        
         | fastball wrote:
         | This is software that directly helps their business, so it's
         | not really productivity outside of their business endeavors.
        
       | hades32 wrote:
       | Super nice! It's only missing auto-complete and it'll be light-
       | years ahead of other tools on terms of usability
        
         | chrismccord wrote:
         | There's already a PR for it with a video of autocomplete in
         | action :)
         | 
         | https://github.com/elixir-nx/livebook/pull/208
        
           | losvedir wrote:
           | I'm just gobsmacked at how fast they're moving here. This is
           | incredible.
        
       | AlchemistCamp wrote:
       | I'll admit that I was initially skeptical about Elixir for
       | anything ML related when I first picked up the pragprog book on
       | Elixir and Genetic Algorithms.
       | 
       | Since that time, things have moved quite a bit. Between the
       | Erlang VM JIT, then Nx, and now this, it's starting to look
       | hopeful!
       | 
       | I'm looking forward to digging into this.
        
       | Pandabob wrote:
       | Is it just me or is Elixir being talked/written about more in the
       | past couple of months?
        
         | SatvikBeri wrote:
         | There were 300 elixir stories in 2020, an average of roughly .8
         | per day. In 2021 there have been 89 elixir stories for 108
         | days, so about the same. (Source: hnsearch)
        
           | bostonvaulter2 wrote:
           | Is it possible to tell how many of those hit the front page?
           | I think the majority of those 300 stories in 2020 did not hit
           | the front page. I'm curious how many there were in years
           | prior as well.
        
         | lawik wrote:
         | It is growing and having good adoption. Not a huge language but
         | it also has a fair share of novel features (being built on
         | Erlang) that aren't commonly seen with other langs. So I think
         | it might have a disproportionate visibility compared to size.
         | Lots of work happening in the community, lots of ambitious
         | ideas and releases.
        
         | cultofmetatron wrote:
         | A bunch of startups including my own bet big on elixir 2 years
         | ago and are starting to launch and gain prominence. the first
         | wave of early adopters are coming out with battle stories to
         | share and the conclusion is that elixir is the real deal.
        
         | cpursley wrote:
         | Years.
        
       ___________________________________________________________________
       (page generated 2021-04-18 23:00 UTC)