Livebook: Getting Started

February 13, 2023

What is Livebook?

The easiest way to explain Livebook is to say it’s Jupyter notebook for Elixir.

Another way? What if Word and Excel had a baby?

screenshot of a livebook

Why Livebook?

As an Elixir developer, I didn’t really understand where Livebook was supposed to fit. After all, I already knew how to start a new project, or launch iex (Elixir’s REPL).

What I found:

Maybe it fits a middle ground between throw-away script and new GitHub project 🤔

Last, but not least, with syntax coloring, code completion, and code formatting, it’s a surprisingly good coding environment:

features mentioned above, visually

Let’s get you started.

How to Install?

steps above, visually

What did you just install?

Livebook runs in your browser – but the supporting code is what you installed.

There are other ways to install, but I wouldn’t recommend them unless you have very specific needs.

How NOT to Run Livebook…

Of course, you COULD just double-click the Livebook icon. Personally, I found that confusing (especially when I was getting started)

what Livebook looks like, when you first open it

What is all this? How do I start to code?
(let’s come back to this page later)

How to Run Livebook: What I Recommend Instead

If you have some Livebook files already:

a folder with some Livebook files

If you don’t have Livebook files ready to go: know that an empty file is a completely valid Livebook file! 😄

> touch first.livebook
> open first.livebook      # open, on macos, is like double-clicking...

what an empty Livebook looks like

Starting from a file has a few advantages:

What Now?

To get an idea, you can watch the “Announcing Livebook” video


Another perspective is the one I linked above, solving Advent of Code with Elixir:

Where’s the Documentation?

When I started out, I was really confused: where’s the documentation?!

The Livebook website feels like a sales pitch … no documentation? 🤔

Fortunately (or unfortunately), the Livebook documentation is found … inside Livebook. (and if it’s somewhere else, I haven’t found it)

Let’s loop back to what you see if you just open Livebook (without a file).

what Livebook looks like, when you first open it

If you click “Learn” on the left, or “LEARN – see all >” in the middle, you will end up on this page:

the documentation page is found

If you click on one of the cards, it will open a Livebook to explain some aspect of Livebook (insert Inception reference)

I strongly recommend the one called “Welcome to Livebook” (click the blue button, seen in the screenshot above). That Livebook does a good job getting you to 80-90% of what you need to know.

Conclusions

Using Livebook is a real pleasure, and I regret waiting so long to install and play with it.

Even using it a little bit allows you to really “get it”.

Whether this is your way to get started with Elixir, or you’re a veteran, Livebook has something to offer 🔥

(if not, it’s also easy to uninstall 😜)

Discuss on Twitter