munificent / craftinginterpreters

Repository for the book "Crafting Interpreters"
http://www.craftinginterpreters.com/
Other
9.02k stars 1.06k forks source link

Why naming the language 'Lox'? #703

Closed MatheusRich closed 4 years ago

MatheusRich commented 4 years ago

I'm pretty in the begging of the book and I didn't saw an explanation for this. I'm not a native english speaker so I may have missed something here.

wjl commented 4 years ago

To be fair, the background of this is covered in the introduction's end note with the heading "Design Note: What's in a Name?". Although it doesn't explain exactly why he chose "Lox" it does explain a lot of things that go into choosing a name and ends with the advice "If the names of the world’s other successful languages teach us anything, it’s that the name doesn’t matter much. All you need is a reasonably unique token."

MatheusRich commented 4 years ago

Yeah, I read that. I was just curious why Lox in particular. I think it doesn't matter in the end.

WanderingStar commented 4 years ago

I read it as a breakfast joke. There are a lot of references to breakfast, and "lox" is smoked cured salmon that is commonly eaten on bagels for breakfast.

munificent commented 4 years ago

There's no strong reason. The original name was "Vox", which is Latin for "voice" and seemed fitting for a programming language and especially one in a book teaching languages. But it's apparently so fitting that someone else had already claimed the name. "Lox" was lexicographically nearby, and I like breakfast food. :)