Lisp Interpreter with GC in <750 Lines of Odin (and <500 Lines of C)
Original: Lisp interpreter with GC in <750 lines of Odin (and <500 lines of C)
Key topics
A Lisp interpreter with a garbage collector has been implemented in under 750 lines of Odin and less than 500 lines of C, sparking a lively discussion about the project's merits and the Odin language itself. Commenters are praising the concise implementation, particularly the semi-space garbage collector, and debating the benefits of Odin over C, with some questioning whether Odin truly eliminates undefined behavior. As one commenter pointed out, the Odin version appears less verbose, although syntax novices are scratching their heads over certain constructs, like the dual assignment operators. The thread is abuzz with curiosity about what makes Lisp implementations so compact and whether there's something inherent to the language that enables such brevity.
Snapshot generated from the HN discussion
Discussion Activity
Very active discussionFirst comment
3d
Peak period
49
84-96h
Avg / period
12
Based on 72 loaded comments
Key moments
- 01Story posted
Aug 30, 2025 at 7:35 PM EDT
4 months ago
Step 01 - 02First comment
Sep 3, 2025 at 12:35 AM EDT
3d after posting
Step 02 - 03Peak activity
49 comments in 84-96h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 7, 2025 at 3:39 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
Also I've moved it from Github to my own Forgejo instance: https://git.liten.app/krig/LISP
My impression of Odin is that it's a better C while still very much retaining the same flavor as C. It adds very little (no classes, no runtime) so porting from C is very straightforward, and it fixes a lot of the dark corners of C. It also seems to be pretty much finished as far as the language goes, so no big incompatible changes coming as far as I can tell.
I would say though that while the memory management story is vastly better than C^, it's still manual as fuck, so be prepared for that.
^: There's builtin test support, bounds checking and an optional leak detection allocator, plus as far as I know no UB.
This mostly just ends up meaning that Odin's creator Ginger Bill will engage in pointless semantic arguments in which he defines away your problem.
There are places where C could reasonably have chosen to define what happens, or to make it Unspecified rather than Undefined, and so that's what Odin chooses, which is a meaningful benefit. However there are plenty of situations left in which what you've written would be UB in C and absolutely anything might happen, while in Odin absolutely anything might happen but Bill insists it isn't UB.
But I haven’t looked very closely at it myself, hence the afaik qualifier.
https://odin.godbolt.org/z/8onn4hxP1
This brief example makes a hash map, then it demonstrates that if we call a sub-routine which makes its own distinct hash map, that doesn't change ours, but, once we destroy our hash map and call the sub-routine again, we can still use the variable for our (destroyed) hash map (!) but doing so reveals the contents of that other hash map from the sub-routine instead in the cases I saw.
Now, in C or C++ if you do this that's Undefined Behaviour and the symptoms I saw (and which you're likely to see if you follow the link) are just one of arbitrarily many ways that could manifest.
In Rust of course the equivalent code won't compile because the hash map is gone so we can't just go around using it after that.
And in Odin, well, as Ginger Bill has explained Odin does not have Undefined Behaviour so... this has behaviour which er, Odin has not defined ? Does that make you feel warm and tingly or do you feel like Bill just wasted time arguing semantics?
This statement is incoherent. UB is undefined behavior, and it existed long before any compiler exploited it and isn't (circularly) defined by whether the Odin compiler exploits it.
My take on what he is saying is that the odin compiler won't try to exploit that there is some behavior which is platform-defined or only knowable at runtime to do aggressive optimizations etc.
https://xcancel.com/TheGingerBill/status/1495004577531367425
To point out that use after free is possible in Odin is not really a gotcha unless you really are just arguing semantics. That's by design, just like use after free is possible in C or C++ or Rust too.
I programmed in C for over 30 years and was a member of the C Standards Committee, which originated the language about undefined behavior ... I know what I'm talking about.
> To point out that use after free is possible in Odin is not really a gotcha unless you really are just arguing semantics. That's by design, just like use after free is possible in C or C++ or Rust too.
This completely misses the point and is a failure to understand at every level. Being able to use memory after being freed is not by design -- no one intends it, no one wants it. It's undefined behavior, and a program that does it is buggy. The reason that it's possible is because it's so hard to detect or prevent. To do so requires escape analysis, lifetime declarations, borrow checking, etc. etc. And no, use after free is not possible in Rust--not in safe code. It's hard to respond to that statement without being rude, so I will say no more.
In a language with UB, the use after free is UB. Which explains the nonsensical results.
If you're pretty sure this all makes sense, I recommend one tiny tweak to further unsettle you, change either (but not both) of the int types in my example to u8 instead. Now the use after free also results in type confusion - Odin has no idea this isn't the same type and so the machine code generated is for one type but the actual bits are for a different type with a different layout.
Bill's go-to is to blame somebody else, it's the operating system, or even the CPU which should define what happens and so it's not his fault. The thread you linked does this. But for type confusion those are Odin's types, nobody else can define how Odin works, the answer must come from Bill. What is supposed to happen here? Linux didn't define your programming language, Intel didn't define your programming language, this is your fault Bill.
2. Odin 0s out memory when declaring a variable unless you explicitly state so with ---. This defines the state of memory when allocated.
Odin's decision to zero initialize local variables isn't relevant here.
Please don't be pointlessly insulting. The description matches many people's experience.
"He was mean to me once" isn't that interesting, especially without anything concrete to back it up.
I haven't seen the conversations he is referring to, he didn't link to or quote anything. It's just some general complaint about Bill, which may be true but who cares?
As for my "highly opinionated" things, honestly, I don't think I am that opinionated about many things, but I guess the ones I am on, they are the "well known" aspects. If I am wrong about something, I will gladly change my opinion given a good argument or set of facts.
https://git.liten.app/krig/LISP/src/branch/main/komplodin.od...
Andy Wingo has a good summary of how a very similar implementation works:
https://www.wingolog.org/archives/2022/12/10/a-simple-semi-s...
Are there two types of assignment?
What should this mean? The comma notation usually indicates a pair or left-to-right control flow (Python and C, respectively), but why (appear to) assign a pair to itself? This probably means something else, but it reads odd. If Odin is so similar to C, what are the "dark corners" where it outshines it?>
> p1[0] = 0
> ...
> n := 0
>What should this mean? The comma notation usually indicates a pair or left-to-right control flow (Python >and C, respectively), but why (appear to) assign a pair to itself? This probably means something else, but it reads odd.
= is assignment and := is assignment and declaration.
You can explicitly give the variable a type by adding it before the = There is also :: for constants.> car, cdr := car, cdr
Odin has multiple assignment like Python, so this is a swap without temporary. edit: No, it isn't! Didn't read carefully. Swap would be
This one is because parameters are immutable in Odin, so to get a mutable copy in the function we have to declare it.> If Odin is so similar to C, what are the "dark corners" where it outshines it?
Off the top of my head:
- No undefined behaviour
- Builtin string type, dynamic array type, slices
- Builtin map type
- Excellent tooling for 3D math: swizzling, matrix math, array programming
- Bounds checking
- Tooling for memory management: leak detection, temp allocator, arena allocators
- Builtin unit test framework
- Tagged unions with exhaustiveness checked switch statement
- for ... in loop syntax
I believe I saw someone demonstrate that almost nothing in a Lisp implementation was written as a "built-in" language feature that required the underlying interpreter to provide the functionality.
https://news.ycombinator.com/item?id=9699065
https://speakerdeck.com/nineties/creating-a-language-using-o...
I could imagine writing a very basic forth or lisp compiler in assembler, but even that would be quite the project.
It does not need to be compiled to be a Lisp. It doesn't need arbitrary precision integers. It doesn't need hash tables. Garbage collection doesn't have to work; it can just run out of space and terminate. It can just crash on errors without a trace. It doesn't need to report the line number where a syntax error likely began. You get the picture.
Any memory management solution will run out of space and terminate unless there is literally infinite memory available.
But I guess hash tables is what people think about when thinking about what makes something a lisp or not.
See?
There you go, mrweasel; I think we hit the nail on the head.
quoting the submission verbatim:
The original paper of LISP by John McCarthy http://www-formal.stanford.edu/jmc/recursive.html
Or the more accessible explanation by Paul Graham http://www.paulgraham.com/rootsoflisp.html
The parser is very simple thanks to the s-expressions, and the only builtin special forms really needed are quote, cond and lambda, that’s pretty much it. The only data structure is a list, so functions are just lists, function calls are lists etc.
Glad he has helped you. Maybe he listened to me, maybe not, but last time (almost year ago?) I saw an interaction with him on GitHub, he was nothing short of an a**hole, and not in the sense of Linus or Theo. In fact, he was not educational, he was just like "Many problems. I could write this better, GTFO". I saw it on GitHub, so I am reluctant to submit a PR of any sort myself in before he tells me he can implement it better and rejects my PR with this reasoning as he did with someone else. Like yeah, of course you may be able to implement it better, whereas someone new to the language might not, even though I tried it (the rejected PR, which was supposed to end up in vendor/ not the core library, AFAIK) and it was fully functional (and without any leaks), and to my eyes it seemed fine as well, but maybe I do not know Odin enough. In fact, I probably do not know it as much as he does, but by his logic, everything should be implemented by him because he knows better. This experience (albeit not mine) was enough to put me off of Odin. The C3 lead developer, on the other hand, was extremely helpful here on HN and on GitHub as well.
I have a feeling he has helped you because of the article and some fame along with it. :)
So my comment reflects a negative publicity. I cannot find the GitHub link right now, but it is there as it cannot be deleted, AFAIK. Look around rejected PRs in / for vendor/, I think. I am not logged in to GitHub and I cannot do so at the moment.
Just my second-hand experience. Feel free to down-vote but please leave a comment afterwards. Not everyone and everything is sunshine and butterflies. The down-votes DO NOT invalidate anything. Or perhaps Bill's bots / fans are in play here. ;) God forbid someone voices negative experiences with a person. Only positives are allowed! I forgot...
But I’m also an old. If someone tells me my code is shit, 1) they are probably right, and 2) I don’t really care. I can probably look at their code and find flaws in it.
In the end, Odin is Bills project and he decides what goes into it, I’m fine with that.
> In the end, Odin is Bills project and he decides what goes into it, I’m fine with that.
Me too. I am just not going to contribute. No big deal.
> I haven’t had any such experience, quite the opposite.
Just to add some positive, too: I have had positive experiences with other contributors.
In any case, I follow the programming language's developers before I contribute, as you may have noticed.
[1] But then again, I do not know the language too well either. Those pointers would have helped me and many others.
Makes sense! Plenty of other languages and projects out there.
> Plenty of other languages and projects out there.
You are right. I do like Odin though, as a language, so it is a pity.
Depends on my mood; maybe go to the Odin Reddit, Discord or CodeReview StackExchange and say "GingerBill has rejected my PR for 'many problems' can I get some hints what, so I can make a better PR?" and then take my better PR back and update the original making it as clear as I can that I have made a good faith effort to improve it.
Or wait a couple of days (weeks?) and review my code with fresh eyes (and wait for the reviewer's mood to change).
Or reply "I'd be happy for you to rewrite it better, I just want the feature it doesn't have to be my code"
Or ask "Many problems, but how many of them are dealbreakers? Is there a route to a minimally viable commit which settles on a good enough interface, and the rest of the implementation can be improved later?"
Or ask "I'd hope you can write it better, you've been Odinning a lot longer than I have, can you point out some of the problems so I can learn more?"
Or if I was giving up on getting it committed, "You say you can write it better, so are you going to?"
> "Would you not have expected at least SOMETHING as to what is wrong with it?"
I have been on the internet long enough to be on both sides of "it's nice to be nice" and "where to start it's not even wrong" and to expect busy, capable, computer people to be time crunched and terse/blunt. There's a difference between "many problems" and "many problems, Get The Fuck Out". A difference between what Linus Torvalds and Erik Naggum used to do and a 3 second glance "too many problems to commit, rejected". Have you seen the accusations of what goes on behind closed doors in the C++ standards committee? Or Scheme world?[1] Does that put you off the languages or is that fine because it only happens to other people?
Progressive disclosure could say that if you cared and wanted to fix up the PR you would have engaged and asked, and if you didn't ask that suggests you weren't interested and that saved Bill's time writing a longer comment. I guess I expect that the Thing_I_Want is not something others care about and if I want to 'change the world' I will have to push some boulders up hill to get there, or push some people to drag their attention to my thing instead of whatever they are doing, and Thing_I_Want generally is not world changing enough to warrant that.
[1] I could go and find them and link them here, but I'm not going to because you might a) know, b) not care, and if I do then I'll get dragged into HN arguments about those accusations which isn't really relevant, but your grudge would be stronger if you had many documented examples showing a pattern of rude, cruel, damaging behaviour, rather than one example which you remember as being unfairly rude but can't find.
> it only happens to other people?
What I am talking about did happen to someone else, not me.
In any case, I will take your advice and ask around despite it not being my code, but I genuinely want to know what is wrong with it because I took a look at the code and I could not spot any issues with it, and I tested it, it works, so I wonder what really is wrong with the code despite its test cases passing, and the code seemingly being organized and seems to be Odin-style. He mentioned something about the person not knowing what "distinct" is, but he also said "many things are wrong, so many that he would rather just rewrite it himself" (which I doubt he has any intentions of doing). These issues surely cannot be such deal-breakers considering the code does run (without any memory leaks). I will ask around when I can be bothered.
https://odin-lang.org/community/ - here's the forum, the IRC channel, the Discord invite, the subReddit link, or you could have commented in GitHub in the PR while you were looking at it.
All of these would be less effort than the comments you've made here in this thread, instead you've taken a second hand grudge and used it to give a small project a good kicking based on an exchange you haven't linked here for any reader here to form a judgement about, for reasons you don't understand and can't be bothered to find out, and then accused people of being bots and astroturfing. [I have followed two of Karl Zylinski's videos in Odin last winter; I have not used Odin in months. I have no stake in Odin].
How is that reasonable behaviour, a useful HN comment for HN readers, fair to GingerBill / Odin, or a step towards getting you the information you "genuinely want to know"?
I am not going to continue on this conversation. Someone else have also said that he is famous for the thing I have brought up, so I am not alone with it, apparently.
Is it fair to him? No. Was he fair to the person submitting the PR? That is another no. Minimizing it by "probably had a bad day"? Is that reasonable? No, not to me. But then again, seems like it was not the only instance.
> All of these would be less effort than the comments you've made here in this thread
Fair enough. Perhaps I am just afraid of the reactions.
I guess there are a few things I could do in that situation. Move on to something else, try to figure out why he didn’t like it on my own, fork the language if it’s big enough and important enough to me.
But yeah, maybe he is busy? Maybe he thinks you are capable of working it out yourself?
Not to be too harsh about it, but yeah, that’s just the way it is sometimes. Maybe he was having a bad day, that happens to people.
That explains why the C code is so neat. You don't see young'uns write such compact C code any more. Well done.
After years using higher-level languages, my C code has become verbose and clunky, when it doesn't necessarily have to be (and memory safety is no concern)
"Please don't post insinuations about astroturfing, shilling, brigading, foreign agents, and the like. It degrades discussion and is usually mistaken. If you're worried about abuse, email hn@ycombinator.com and we'll look at the data." - https://news.ycombinator.com/newsguidelines.html
You half remember one blunt interaction that you conveniently can't find and you're dedicating your life to shitting on him and his project. How is that on-topic here?
I removed the link now.
Do you have any specifics?
"Ginger Bill" refers to Bill Hall, the creator of the Odin programming language, who is known for his outspoken and opinionated comments on programming and software development. His argumentative style can be seen in his blog posts and social media, particularly on X (formerly Twitter), where he often presents strong opinions on programming aesthetics, language design, and the open-source software movement.
Examples of his argumentative style
Software is not traditional property: In a blog post titled "Unstructured Thoughts on the Problems of OSS/FOSS," Hall argues that intellectual property, specifically software, is not "property" in the traditional sense because it is "trivially copyable". This is a provocative stance that challenges common views on intellectual property rights.
Criticism of open-source ideals: In the same article, he asserts that the open-source software (OSS/FOSS) dream is just a "dream that cannot live up to its 'ideals'". He argues that many of the perceived benefits of OSS are merely hypotheses and that the movement is based on "blind-faith".
Aesthetics in programming: Hall has made seemingly non-negotiable declarations about coding style. On X, he once posted, "Code indentation that is anything but 2, 3, 4, or 8 characters wide, is objectively a bad style from a pure aesthetics standpoint". While humorous, it exemplifies his tendency to make definitive statements on subjects that are often matters of convention.
Language semantics over syntax: He argues that the focus of language design should be on core semantics rather than "syntactic sugar". He believes that when the core semantics are good, the syntax will naturally follow and feel "joyful" to use.
Arguments against common practices: Hall is also known for taking firm positions against widely used programming practices, such as his blog post "Exceptions—And Why Odin Will Never Have Them". Overall, his argumentative nature stems from a deep-seated philosophical position on software design and engineering, which he shares to provoke discussion and advocate for the principles he believes are best for the craft.
https://anthonymoser.github.io/writing/ai/haterdom/2025/08/2...
I found the comment(s):
[REDACTED]
> I am closing this PR because it would be quicker for me to write my own bindings than explain everything wrong with it and then hope they get fixed correctly.
The funny thing is that we are talking about a vendor library, one that does actually work (I tested it as I needed curl in Odin)! Seems like the major issues were purely stylistic.
BTW "Please try to keep the original naming conventions and DO NOT change it to Odin's core convention." and "Maybe remove the CURL prefix?" are contradictory.
It is "CURLOPT" in curl.h. "OPT" seems out of place. I am not even sure what I would have named it were I to follow his advice. You?
I don't find it too hard to figure out what he meant - he doesn't want to you change the case style of procedure calls, but he _does_ want you to remove redundant namespacing as in the CURL prefix.
Maybe you could have looked at some other vendored libraries to see how they handled things like constant naming and other formatting?
Some guy did ask questions I would have asked, at least.
Back to the CURL prefix, what is wrong with it? It is how it is in curl.h and without it, it looks kind of meh. What would the "CURL" distinct type be without the CURL prefix? :P
I hope I did not make a mess just by posting the URL. I will remove it. I do not need more (supposedly trolls) in there and make more of a big fuss than I did on here.
It prevents stuttering when using it `curl.CURL_*`.
> What would the "CURL" distinct type be without the CURL prefix?
`CURL` isn't a prefix there.
Take more time to think things through.
It's called trolling. He hasn't made a single productive comment.
I did not personally mind Odin's exceptions, to be honest. I prefer Odin's way, and Go's way, too.
> you'll have to dig for them yourself.
Yeah I was referring to such specifics, but I will take a look at Discord perhaps.
> "Code indentation that is anything but 2, 3, 4, or 8 characters wide, is objectively a bad style from a pure aesthetics standpoint"
Those are just opinions. I prefer 2 spaces, or tab with 2 column width. I tend stick to one style in my codebase, consistently. I do not like anything longer than 2, because I have a small screen and I think it is just simply redundant. I can follow 2 column width indentation just fine. This is just my opinion. If I use tabs, people can choose their own, it is up to them.
The function/struct definition in C could be placed in a header.
Of course, git cloning the ALE plugin (linter + languageserver) for VIM also fails as ALE has an .odin file in its repo.
16 more comments available on Hacker News