Maartz

Maartz

Build It With Nitrogen Book Club

The very first time I’ve seen a line of Elixir I was in awe. Coming from Ruby the syntax was familiar.
But I wanted to know what was this “Erlang” beast, scaring so many people.
Erlang’s syntax was in fact not so “atrocious” and even quite nice.
And after watching this talk from Todd Resudek, I was convinced that to better appreciate the BEAM ecosystem, you need to grasp Erlang.

And so I’ve bought this book, it’s pretty thick but, I’m very eager to read how they dealt with all HTML, forms, string, etc. that the web represents.

I’ll use this book club to tell you how’s the journey and what are my thoughts about it.

Most Liked

OvermindDL1

OvermindDL1

The Nitrogen library is so fun. ^.^

Maartz

Maartz

Chapter 1 - Frying Pan to Fire

I really like the way the book is written. It’s like a story. It’s very different from all the other books of the same category.

Installing Nitrogen is not like installing rails nor phoenix, you need to clone the nitrogen repo under nitrogen/nitrogen.

After that, by cd into the nitrogen folder, it will generate a fresh new app with make.

make rel_inets PROJECT=devtalk

By inspecting the Makefile I can see that you’re not forced to use one specific web server like Erlang’s basic one.
You can choose between – all with different versions like slim:

  • Cowboy
  • Inets
  • Mochiweb
  • Webmachine
  • Yaws

To be honest I only knew the existence of Cowboy and Inets. Probably gonna check the others.

By cd into devtalk and running bin/nitrogen console the server starts running on 8080.

The code which interests me is under the site folder.

By crack opening the templates/bare.html as suggested by the book, I can see this:

It seems to be the Nitrogen’s “secret sauce”. Like sharding for MongoDB web-scale…

I really like the little notes like this one:

Most of the Erlang community prefers Emacs,
but the authors are oddballs and prefer Vim.

I agree a 100 percent :laughing:

It’s important to note that since Nitrogen 3, it uses Rebar3.
Also that ViM and Emacs got an extension to handle a special indentation for Nitrogen.

It goes from this:

Elements = #panel { body=[
                         #span { text="Hello, World"}
                         ]},

to this:

Elements = #panel {body=[
    #span{text="Hello, World!"}
]},

Which is in fact probably quite helpful in a big file.
The syntax reminds me of Elm, and its special way to define HTML in this style.

This first chapter is a little ice breaker, nothing too technical, but it lays the foundation of the book. I kinda like it.

AstonJ

AstonJ

Ooo exciting stuff @Maartz!! I’m looking forward to following your journey with this book and Nitrogen!

I’ll be interested in hearing your thoughts how things differ from Elixir/Phoenix-land as well if you post any :nerd_face:

Popular Community topics Top

mafinar
Crystal recently reached version 1. I had been following it for awhile but never got to really learn it. Most languages I picked up out o...
New
Maartz
The very first time I’ve seen a line of Elixir I was in awe. Coming from Ruby the syntax was familiar. But I wanted to know what was thi...
New
ohm
I would love to begin a book club with Mike Amundsen’s (@mamund) book Design and Build Great Web APIs. It seems that building new syste...
New
TwistingTwists
This is my Journal for readings on Designing Elixir Systems with OTP. Will post chapter 01 tomorrow! Stay tuned!
New
ggarnier
In Aborting Multiple Fetch Requests with One Signal section, the code in abort/abort_ex09.js doesn’t show the downloaded images until Pro...
New
rgerardi
Hello all. Creating this space here for general discussion and chat about Powerful Command-Line Applications In Go In particular, we ca...
New
adamaiken89
Anyone is interested in a classical textbook for algorithms can go and check that.
New
AstonJ
With AI set to play a big role in our industry Elixir users are lucky to have Nx, so we’re running our Nx related book club on Genetic Al...
New
AstonJ
With Phoenix and LiveView having recently had a fairly major release, and Programming Phoenix LiveView being updated too, we thought it w...
New
PragmaticBookshelf
When the pandemic, heart disease, and personal tragedy threatened to steal everything the Tates spent years building, they found hope, he...
New

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
DevotionGeo
I know that -t flag is used along with -i flag for getting an interactive shell. But I cannot digest what the man page for docker run com...
New
New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New