Skip to content

Instantly share code, notes, and snippets.

View Stamates's full-sized avatar

John Stamates Stamates

View GitHub Profile
Mix.install [:benchee]
list = Enum.to_list(1..10_000)
map_fun = fn i -> [i, i * i] end
Benchee.run(
%{
"flat_map" => fn -> Enum.flat_map(list, map_fun) end,
"map.flatten" => fn -> list |> Enum.map(map_fun) |> List.flatten() end
},
@Stamates
Stamates / livbook_blogpost.livemd
Last active May 20, 2021 15:32
Distributed Elixir with Livebook

Distributed Elixir with Livebook

Livebook, Elixir's version of Jupyter notebook

Livebook recently dropped and I was curious to see what the hype was all about. I had dabbled with ipython notebook (Jupyter) long ago, so I was curious to see what an Elixir version would offer.

Some Googling will tell you that the primary improvements offered by Livebook over Jupyter are:

  • Live collaboration on a notebook (think Google docs), although this is possible for Jupyter using tools like CoCalc and Google Colab
  • Saved files are readable (just markdown)