4 ms·
Odin's official compiler is not a "simple implementation", and Odin was not designed to be trivial to implement either. Where did you get this falsehood from? N
by gingerBill 3y ago
Odin's official compiler is not a "simple implementation", and Odin was not designed to be trivial to implement either. Where did you get this falsehood from? None of what you said is correct.
Odin is fundamentally about simple as-in _intuitive_ to use, and intuition are anything but simple as-in _simplex_. Intuitions are extremely complex and complicated things, even if they seem "easy" to use.
Designing for people's intuitions about what feels right and feels "intuitive", is a lot more complicated than you realize. The entire constant value system requires a big-number implementation to get right.
Looking at the compiler for more than 10 minutes would you should that it is anything but trivial (I will refrain from using the term simple here since it is overloaded). Odin is more complicated than C, but less complicated than C++. That is both in terms of the language and the compiler itself. You can write a C compiler is <8KLOC (in C). It would probably take <50KLOC to write a _minimal_ Odin compiler (in C), if not more.
- tialaramex 3y ago> Where did you get this falsehood from? Which falsehood? That K&R C was written to fit on the PDP-11 and its limitations reflect that? I think that's well attested. It may very well be that Odin fits your intuitions, it certainly doesn't fit mine. Take your "range based for loop" - it does something for a handful of built-in types. What it does is presumably whatever your intuition said it should do, and then for custom types it just doesn't work at all. I'm sure that in your mind this is simple, "It just does what you expect". But to my mind it's extremely complicated - it does these different specific things I'd need to remember, and in any other cases it's just not legal Odin at all. > The entire constant value system requires a big-number implementation to get right. Unless "big-number" is rather over-stating what was needed here I don't get this.