Lisp interpreter with GC in <750 lines of Odin (and <500 lines of C)

94 pointsposted 5 days ago
by PaulHoule

83 Comments

mrweasel

a day ago

Is there something inherent to Lisp that allows it to be implemented in so little code?

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.

krig

a day ago

First off, you wouldn’t write an actual interpreter for lisp like this if you wanted to use it for anything serious, it’s very slow.

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.

rollcat

a day ago

Lisp (and similarly, Forth) is closer to a mathematical construct than an actual language. We've had to wrap it in parentheses and named symbols to help make sense of it, to talk about it. Pairs, atoms, GCs, are all an implementation detail.

krig

a day ago

This is my project! I made the Odin version to learn the language, not to create a 1:1 comparison. I 100% prefer Odin over C and will use it wherever I can where I would have otherwise used C.

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.

psychoslave

a day ago

Does it get ride of undefined behavior and the tradition of obfuscating the code with monoletter identifiers?

krig

a day ago

Yes. There is no undefined behavior in Odin (afaik), and I haven’t seen many monoletter identifiers. There is a slice type and a for … in loop statement so that gets rid of most i:s and j:s.

tialaramex

a day ago

> There is no undefined behavior in Odin

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.

krig

a day ago

Well, without concrete examples this just sounds childish TBH.

But I haven’t looked very closely at it myself, hence the afaik qualifier.

tialaramex

a day ago

So as a concrete example:

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?

krig

a day ago

Well, sure. If that’s what you mean by having UB then it’s trivially true for any language with a C FFI for example, or rust with unsafe. I guess what I consider UB is when the compiler exploits UB for optimizations, like discarding code that could invoke UB, which as far as I know odin doesn’t do.

jibal

a day ago

> I guess what I consider UB is when the compiler exploits UB for optimizations, like discarding code that could invoke UB, which as far as I know odin doesn’t do.

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.

krig

a day ago

Well, the statement is circular, colloquial speech doesn't have to be coherent. It's my understanding of what people generally mean when they complain about UB in the C standard, and it seems to be what gingerbill means too.

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.

tialaramex

a day ago

> To point out that use after free is possible in Odin is not really a gotcha unless you really are just arguing semantics

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.

jibal

a day ago

Your understanding is completely wrong. UB means "undefined behavior" -- behavior that is not specified by the language standard or the implementation. UB being exploited by the compiler is a separate issue. Saying that there is no UB is saying that there's no undefined behavior; it is certainly not merely saying that the compiler doesn't exploit it.

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.

krig

a day ago

Well, first of all, I guess I am wrong! Hey, I'm not Bill, just a user of the language.

A couple of clarifications, though: I did mean unsafe rust, not the safe subset. No need to get rude!

Second of all, I am of course not under the illusion that Odin prevents use-after-free (and thus, technically, it does allow UB I guess). I just don't think Bill is either. So clearly he doesn't mean UB by the same definition as you do.

_My_ use of UB has always been in the context of what a compiler will do during optimization, and the discussion I've seen in the context of C compilers is that they perform optimizations that remove code or change code in surprising ways because the way the code was written technically resulted in UB. But I'm neither a spec writer or a compiler author, so I don't really care that much about the actual definition of the term.

Anyway, best of luck in convincing Bill to use the term correctly as well! I won't mention UB when talking about the benefits of Odin in the future. :)

jibal

21 hours ago

> So clearly he doesn't mean UB by the same definition as you do.

Wrong.

> so I don't really care that much about the actual definition of the term.

Yes, it's evident that you don't care what's true or about being accurate.

> Anyway, best of luck in convincing Bill to use the term correctly as well!

He does use it correctly, but his claims that Odin has no UB are incorrect.

Over and out.

flysand7

10 hours ago

As someone who knows what they're talking about, I'm curious to hear from you, why you consider use-after-free an undefined behavior and not an unspecified behavior instead?

Because as far as I know both undefined behavior and unspecified behavior are the behaviors that aren't specified in the language standard nor the implementation. So what's the difference?

ixwt

a day ago

This is a simple use after free on the stack. Is that UB?

jibal

a day ago

Yes, of course ... the content of freed memory, on the stack or otherwise, is not defined. (And this is not in fact on the stack.)

psychoslave

21 hours ago

Isn't there a cheap way to implement a gentle refusal to compile a code if it is not garantee that it won't prevent such a behavior?

jibal

14 hours ago

No, definitely not. The solution is something like Rust, with its lifetimes and borrow checker ... not cheap at all.

Hemospectrum

14 hours ago

You mean a borrow checker? That exists, but not for Odin.

ixwt

a day ago

1. I'm fairly certain you have to use make to get into heap.

2. Odin 0s out memory when declaring a variable unless you explicitly state so with ---. This defines the state of memory when allocated.

tialaramex

a day ago

Ordinarily you'd be correct that you need the weird make overload, but I had no cause to invoke make I just told Odin that we don't care and it's fine, check the first line. Whether that feature is a good idea in this language I couldn't say.

Odin's decision to zero initialize local variables isn't relevant here.

ixwt

a day ago

Huh. Wasn't aware of that feature. Good to know.

I didn't fully flesh out the initializing local variables: What part of your code is undefined? You deleted the memory, and the compiler reused it. Then you re-accessed that same memory. That's just part of working with computers. The initialization comment was supposed to be from creating data to releasing it is defined. To be compliant with the Odin compiler spec, it's defined from start to end.

SkiFire13

20 hours ago

Not OP but:

> What part of your code is undefined?

Using a variable (`some_map` in this case) after `delete`ing it doesn't seem something languages usually define in their specification. Does Odin define that?

krig

a day ago

I don't really get the distinction between adding the dynamic-literals feature flag and using unsafe in Rust? Like, if he had called it #+unsafe dynamic-literals, would that have been better?

tialaramex

20 hours ago

I'm going to guess that you've never written, and perhaps never read, any unsafe Rust, because you (in common with several Rust critics) seem to be imagining it like a switch you can turn on somehow to disable the safety rules, and that's not what it is at all.

This Odin feature flag just allows me to write what I meant in Odin, I can write it all out by hand using make and so on without the feature flag, but it's more annoying to spell that all out which presumably was the impetus for this feature flag in the first place. The flag didn't somehow "cause" the unsafety, that's an insane take.

Odin isn't very well documented, so as somebody who was writing Odin just to explain the problem here, the easier option avoids trying to guess which of a dozen undocumented functions with names that may be related to hash maps is the "right" function to do what I meant, I can just write what I meant and turn on the feature flag to acknowledge that it involved allocation.

krig

20 hours ago

I can't reply to the reply to this one (guess the thread is getting too deep), but I just wanted to clarify that I'm not a rust critic, I use rust, I like rust, I have no problem with rust. OK great, moving on...

tialaramex

19 hours ago

The lack of reply is probably because the thing you wanted to respond to was new.

This is a deliberate HN behaviour to discourage frantic conversations, like you might have if this was a Zoom call for example, or we'd had this disagreement in a bar (presumably a bar where there's a Compiler Explorer built in, or maybe literally Matt Godbolt is sat there with a laptop?)

Maybe it works? I have had some positive experiences.

If you know unsafe Rust the comparison to this Odin feature feels odd, but OK. Surely the Odin feature is more like when let-chains was unstable but you could tell the Rust nightly compiler you want that feature anyway ? Or... explicit_tail_calls which gives you a way to write explicit tail calls† in nightly Rust ?

† This is a very cool feature if you're a functional programmer using the "become" keyword, you get tail call optimisation but it's mandatory, if what you've written can't work as a tail call then it won't compile, if it could work it does.

jibal

a day ago

> Well, without concrete examples this just sounds childish TBH.

Please don't be pointlessly insulting. The description matches many people's experience.

krig

a day ago

I'm not the one throwing baseless accusations around.

"He was mean to me once" isn't that interesting, especially without anything concrete to back it up.

jibal

a day ago

First, that's whataboutism. Second, you are, actually. And what the other fellow said is not at all baseless, and he did back it up. GB is well known for being argumentative, highly opinionated, and rude. But people make allowances for those who put in the work, and GB certainly does.

krig

a day ago

First, no it isn't. What baseless accusation did I make?

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?

psychoslave

21 hours ago

Can we stop digression and keep the thread focused on undefined behaviors and practices that makes code less straight forward to read, please?

jibal

21 hours ago

Nothing you say is true. I'm done with you.

jll29

a day ago

Thanks for sharing. Not knowing Odin's syntax yet, having had a quick look at the code, a few things are strange:

Are there two types of assignment?

  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.

  car, cdr := car, cdr
If Odin is so similar to C, what are the "dark corners" where it outshines it?

krig

a day ago

> Are there two types of assignment?

>

> 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.

    x := 1 // create a new variable x with the value 1
    x = 2 // assign 2 to x
    y = 3 // error: y does not exist
You can explicitly give the variable a type by adding it before the =

    x : u8 = 1 // a one byte unsigned integer with the value 1
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

    car, cdr = cdr, car
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

gritzko

a day ago

It lacks a conclusion, except I can see that 750>500

johnisgood

a day ago

> When I posted this to lobste.rs, gingerBill (creator of Odin) was kind enough to make a more direct translation of the C code into Odin.

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...

jodrellblank

a day ago

> "The down-votes DO NOT invalidate anything. Or perhaps Bill's bots / fans are in play here"

"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?

jibal

a day ago

Many people have had similar experiences with GB ... he's famous for it.

johnisgood

a day ago

And here I thought this was a one time thing (someone said he may have had a bad day). :|

Do you have any specifics?

jibal

a day ago

First, I want to be clear that Ginger Bill has put in the work and stands behind his convictions. But convictions he does have, and being strongly and forcefully opinionated has consequences. Here's a summary from Gemini ... which really isn't objectionable at all. If you want specific examples of him getting into arguments with people or being dismissive, you'll have to dig for them yourself.

"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.

johnisgood

21 hours ago

I have read the post about exceptions: https://www.gingerbill.org/article/2018/09/05/exceptions-and....

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.

krig

21 hours ago

Dude, I find it utterly offensive that you and the other guy keep referring to all these interactions with Bill where he was a mean boy, and yet the closest to an actual quote or reference is some Gemini slop? If you're going to be that lazy, it would be easier to not post anything at all.

https://anthonymoser.github.io/writing/ai/haterdom/2025/08/2...

johnisgood

21 hours ago

So you feel offended on behalf of someone else?

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?

krig

21 hours ago

Is that really the whole reason for this grudge? He gave you a bunch of comments to work from! I was expecting a lot less from your description.

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?

johnisgood

21 hours ago

I posted the link and now the PR is getting filled with comments. Lord. This is why I did not want to look for and post the link to begin with!

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.

thegeekpirate

20 hours ago

> Back to the CURL prefix, what is wrong with it?

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.

johnisgood

20 hours ago

I did, thank you. Please explain why would anyone (end user of library) ever want "curl.CURL_GLOBAL_ALL", for example? If anything, it should be private. If you really want to go there, sure. I think it is YOU who should think things through. I get that you are filled with hatred, but come on man. Think. Why would anyone want to call "curl.CURL_GLOBAL_ALL" from a binding which is supposed to be used as a high-level curl library? If it is possible (I have no idea) to make it private, then it should be made private. It is not intended to be used by the users of the library, is it? The higher level functions are the ones supposed to be used by them, and they seem to be named correctly from a quick glance.

If you reply, do so without ad hominems and with some respect. Thank you.

thegeekpirate

19 hours ago

Last question I'll answer, because you aren't doing any of this is good faith.

You mean `curl.GLOBAL_ALL`, and it's for https://curl.se/libcurl/c/curl_global_init.html

johnisgood

19 hours ago

  // CURL_GLOBAL_ALL combines all initialization flags.
  CURL_GLOBAL_ALL: i64 = 3
It has nothing to do with "curl_global_init()". This - which is a high-level function intended to be called by the users of the library - has:

  init :: proc() -> (ok: bool) {
    return curl_global_init(CURL_GLOBAL_ALL) == 0
  }
As you can see, higher-level function calls low-level function. The higher-level function does not have "curl" as the prefix.

My question still stands and has not been answered.

jibal

21 hours ago

> So you feel offended on behalf of someone else?

It's called trolling. He hasn't made a single productive comment.

krig

20 hours ago

I used the word "childish" to describe posting comments about someones personality without any references or examples, and here you are doing the same but adding Gemini to the mix... and I'm the troll? :)

krig

21 hours ago

I'm offended by the Gemini slop!

user

19 hours ago

[deleted]

johnisgood

19 hours ago

So there is me, jibal, who else is a troll according to you? And who is the one trying to restrict knowledge just because of trolls? I saw the questions on GitHub. They make sense and I am sure people would like to hear the answer. I know I do. Perhaps the PR guy does, too, Lord knows. I think it is unfair to everyone just because of your allegations, and kind of confirms the things that have been said, but the scope extends. Unfortunately.

krig

18 hours ago

What in the world... jibal was the one who called _me_ a troll, I never called anyone a troll. Lord knows what is happening in this comment section at this point.

johnisgood

17 hours ago

I lost the plot, too, both on here and on GitHub. The PR got locked, too. This was not my intention, I hope it will not affect anyone, I kind of feel bad for the PR guy now. sighs. He has no idea about this mess.

user

20 hours ago

[deleted]

johnisgood

a day ago

If I find it and I post it, would that make it OK?

johnisgood

20 hours ago

I did, I posted it, and someone already commented to each one of the reviews and comments. :|

I removed the link now.

krig

a day ago

Sorry to hear that! I haven’t had any such experience, quite the opposite.

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.

johnisgood

a day ago

From what I remember, it was supposed to land in vendor/ which is not the core standard library though. Additionally, it is one thing to say the code is shit, and another to say "too many things wrong, fuck off", all while the code did work properly! From what I recall the person said he will continue working on it anyway in his own git repository. I think he could have given pointers of these major flaws (I checked the code and I could not find anything either[1]), which could have not been too major if the code worked properly (there were test cases, it did actually work and there were no memory leaks either, FWIW).

> 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.

krig

a day ago

> Me too. I am just not going to contribute. No big deal.

Makes sense! Plenty of other languages and projects out there.

johnisgood

a day ago

My question to you, however, is this: what would have you done if he were to tell you that he can write your code way better (without any pointers) and that concludes the conversation? Would you not have expected at least SOMETHING as to what is wrong with it? Of course ultimately what he says and does is his own business, but I am asking you.

> Plenty of other languages and projects out there.

You are right. I do like Odin though, as a language, so it is a pity.

krig

a day ago

I don’t think he works for me. I am not paying him. To the contrary, if anything _I_ am in debt since I am using all this code that he put out there for free.

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.

jodrellblank

a day ago

> "what would have you done if he were to tell you that he can write your code way better (without any pointers) and that concludes the conversation?"

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.

johnisgood

a day ago

It is not my code, but since I want to know what is wrong with it, might as well ask around.

> 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.

jodrellblank

a day ago

> I genuinely want to know what is wrong with it ... 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"?

johnisgood

21 hours ago

It has been almost a year since I witnessed the incident. Ever since then I did not get back to it, but it stuck. As for reasonable, well that is debatable. Many people use the down-vote feature for shilling or the opposite of shilling. I do not find that reasonable, but it happens anyway. I have been down-voted to oblivion by bots before. Can I prove they were bots? Not really, but many people seemed to think so, too.

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.

uncircle

a day ago

> But I’m also an old.

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)

krig

21 hours ago

That's the nice thing about a little side project, I can just have fun and noodle away at it without worrying about safety or comments ;)

fithisux

a day ago

At first look the Odin version seems less verbose.

The function/struct definition in C could be placed in a header.

nmz

a day ago

750 lines and 0 comments.

krig

a day ago

Some day I might write a walkthrough of it, but it’s just a toy really.

drwu

21 hours ago

The antivirus program forced to be installed by my company does not allow .odin file to exist, as there is a ransomware which encrypts files into *.odin.

Of course, git cloning the ALE plugin (linter + languageserver) for VIM also fails as ALE has an .odin file in its repo.