martin

martin

Where did the name Elixir come from?

I came across a reference to Potion, the language by _why the lucky stiff. It got me thinking that maybe Elixir is a nod and homage to _why. But I realised I don’t know the origin of the name Elixir.

Showing Posts 36 to 27

StefanHoutzager

StefanHoutzager

It wouldn’t surprise me. Dahl loved a beer (stout?) in his favourite pub “the old swan” I saw in a documentary. Maybe he met these men there too: “There was only one disaster. Three silly men who had drunk too much beer for lunch decided to climb over the high fence surrounding the pit, and of course they fell in. There were yells of delight from the giants below, followed by the crunching of bones.” (bfg)

ardhitama

ardhitama

Owh.. come on… it must be have some meaning no? Considering elixir is a cult right now. :laughing:

*jk

alzearafat

alzearafat

When I google elixir, at least I comes to these results :

  • Elixir as programing language
  • Elixir as potion on a game
  • Elixir as a guitar string
  • Elixir as a one of Laravel feature

:laughing: :laughing: :laughing:

But I think Elixir name is cool!

davearonson

davearonson

So Guinness is frobscottle? See Do bubbles in Guinness go down? for some enlightening explanation.

StefanHoutzager

StefanHoutzager

It won’t come from here but somehow elixir reminds me of frobscottle, an invention from Roald Dahl.

In The BFG, he describes frobscottle, a fizzy drink where 
the bubbles fizz downwards instead of up. Upward-fizzing bubbles 
make one burp, something the giants in the book find ‘filthsome’. 
Sophie, the heroine, takes issue with the alternative.

“With frobscottle,” Sophie said, “the bubbles in your tummy 
will be going downwards and that could have a far nastier 
result.”
“Why nasty?” asked the BFG, frowning.
“Because,” Sophie said, blushing a little, “if they go down
instead of up, they’ll be coming out somewhere else with an
even louder and ruder noise.”
“A whizzpopper!” cried the BFG, beaming at her.
“Us giants is making whizzpoppers all the time! Whizzpopping is
a sign of happiness. It is music in our ears! You surely is not
telling me that a little whizzpopping is forbidden among human 
beans?”
“It is considered extremely rude,” Sophie said.
“But you is whizzpopping, is you not, now and again?” asked
the BFG.
“Everyone is whizzpopping, if that’s what you call it,” 
Sophie said. “Kings and Queens are whizzpopping. Presidents
are whizzpopping. Glamorous film stars are whizzpopping.
ittle babies are whizzpopping. But where I come from,
it is not polite to talk about it.”
“Redunculous!” said the BFG. “If everyone is making whizpoppers,
then why not talk about it? We is now having a swiggle of
this delicious frobscottle and you will see the happy result.”
The BFG shook the bottle vigorously. The pale green stuff 
fizzed and bubbled. He removed the cork and took a 
tremendous gurgling swig.
“It’s glummy!” he cried. “I love it!”
For a few moments, the Big Friendly Giant stood quite still, 
and a look of absolute ecstasy began to spread over his
long wrinkly face. Then suddenly the heavens opened and
he let fly with a series of the loudest and rudest noises 
Sophie had ever heard in her life. They reverberated around
the walls of the cave like thunder and the glass jars rattled 
on their shelves. But most astonishing of all, the force of the 
explosions actually lifted the enormous giant clear off his
feet, like a rocket.
“Whoopee!” he cried, when he came down to earth again.
“Now that is whizzpopping for you!”
(Roald Dahl – The BFG 1982)
OvermindDL1

OvermindDL1

I usually pattern match myself, consider these two cases:

myVar = someFunction("blah")

# Case 1
first = List.first(myVar)

# Case 2
[first|_] = myVar

# Case 3
case myVar do
  [first|_] -> useFirst(first)
  [] -> doOtherwise()
end

Case 1 is using List.first, it works.
Case 2 is pattern matching, same as Case 1 but I like it as it makes it explicit what it is doing.
Case 3 is a case statement, longer sure, but the usage of the match is handled and if the list is empty that is also handled.

However, what if myVar was nil? Maybe even through no fault of someFunction/1 but rather some other call or so. Cases 1 and 2 and 3 all crash.

A statically typed system on the other hand has to know what is returned, like given this equivalent OCaml code:

let myVar = someFunction "blah" in

(* Case 1 *)
let first = List.hd myVar in

(* Case 2 *)
let first::_ = myVar in

(* Case 3 *)
match myVar with
| first::_ -> useFirst first
| [] -> doOtherwise ()

Given someFunction "blah" can only return a list (otherwise it throws an exception if an exceptional condition):

  • Case 1 → Compiles and works as expected, returns first as first else throws an exception.
  • Case 2 → Compiles and works as expected, returns first as first else throws an exception.
  • Case 3 → Compiles and works as expected, you handle all paths.

However, given someFunction "blah" can return a list or () (Ocaml’s version of nil) as a Result.t or just an option, say because of an internal refactor later on in the project and the above original code was missed in the update, then:

  • Case 1 → Will not compile, List.first only accepts a variable that can only be a nil
  • Case 2 → Will not compile, the match construct cannot match anything of myVar, have to decompose the option.
  • Case 3 → Will not compile, the match construct cannot match anything of myVar, have to decompose the option.

You either have to withDefault the option/result to a default value to get back to the original handling, or you have to handle the option properly. In either case in a dynamic language this is missed and will crash sometime later (hopefully in tests, most likely in prod, especially if the tests do not test a nil case because there was no nil case originally). Dialyzer ‘might’ catch this if all paths can be confirmed, but that cannot be guaranteed. :slight_smile:

terakilobyte

terakilobyte

Agreed. And you are correct, XCode showed a warning on that line of code. Just playing a bit. So far in my Elixir adventures I’ve yet to try to access an item by index. I either filter down or use List.first/1 or List.last/1

OvermindDL1

OvermindDL1

Heh, though using a decent C/C++ compiler that would be caught since you are using constant values and you’d get a warning, where elixir gives nothing. ^.^

Not that elixir is bad at all, most fully typed languages would not get this either without dependent types support (I.E. not Haskell/OCaml/Elm/etc… very few languages have dependent types, although you can emulate them with OCaml’s modules, they are near unrepresentable in Haskell), just it is a folly to consider it a solved problem. ^.^

terakilobyte

terakilobyte

True, true. But at least it returns nil, vs something like

int main() {
  int test[4] = {1, 2, 3, 4};
  printf("%d\n", test[4]); // Yea, though I walk through the valley of the shadow of death
}
Onor.io

Onor.io

I have to thank you for rekindling my interest in looking at OCaml. I had forgotten how much I like the syntax and with an option like Bucklescript I don’t even have to feel guilty about not wrestling with JavaScript. :slight_smile:

Where Next? Top

Trending in Discussions Top

budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
jtormey
Lately I’ve been thinking about how to organize components as a LiveView application grows. One of the pain points I’ve found (for myself...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews