5 ms·
The author is excited that they can do all the things in Odin that they can do in C. So it strikes me that a new language may be the wrong approach to addressi
by jmull 1y ago
The author is excited that they can do all the things in Odin that they can do in C.
So it strikes me that a new language may be the wrong approach to addressing C's issues. Can they truly not be addressed with C itself?
E.g., here's a list of some commonly mentioned issues:
* standard library is godawful, and composed almost entirely of foot guns. New languages fix this by providing new standard libraries. But that can be done just as well with C.
* lack of help with safety. The solutions people put forward generally involve some combination of static analysis disallowing potentially unsafe operations, runtime checks, and provided implementations of mechanisms around potentially unsafe operations (like allocators, and slices). Is there any reason these cannot be done with C (in fact, I know they all have been done).
* lack of various modern conveniences. I think there's two aspects of this. One is aesthetics -- people can feel that C code is inelegant or ugly. Since that's purely a matter of personal taste, we have to set that aside. The other is that C can often be pretty verbose. Although the syntax is terse, its low-level nature means that, in practice, you can end up writing a relatively large number of lines of code to do fairly simple things. C alternatives tend to provide syntax conveniences that streamline common & preferred patterns. But it strikes me that an advanced enough autocomplete would provide the same convenience (albeit without the terseness). We happen to have entered the age of advanced autocomplete.
Building a new language, along with the ecosystem to support it, is a lot of fun. But it also seems like a very inefficient way to address C's issues because you have to recreate so much (including all the things about C that aren't broken), and you have to reach some critical mass of adoption/usage to become relevant and sustainable. And to be frank, it's also a pretty ineffective way to address C's issues because it doesn't actually do anything to help all the existing C code. Very few projects are in a position to be rewritten. Much better would be to have a fine-grained set of solutions that code bases could adopt incrementally according to need and opportunity
Of course, I realize all this has been happening with C all along. I'm just pointing out that seems like the right approach, while these C alternatives, while fun and exciting (as far as these things go), they are probably just sound and fury that will ultimately fade away. (In fact, it might be worse if some catch on... C and all the C code bases will still be there, we'll just have more fragmentation.)
- gingerBill 1y agoI'm the creator of the Odin programming language and I originally tried to approach it by fixing C. And my conclusion was that C could not be fixed. I made my own standard library to replace libc. The lack of safety is hard to do when you don't have a decent enough type system. C's lack of a proper array type is a good example of this. Before making Odin, I tried making my own C compiler with some extensions, specifically adding proper arrays (slices) with bounds checking, and adding `defer`. This did help things a lot, but it wasn't enough. C still had fundamentally broken semantics in so many places that just "fixing" the problems of C in C was not enough. I didn't want to make Odin initially, but it was the conclusion I had after trying to fix something that cannot be fixed.
- nasretdinov 1y agoI feel like Odin is the closest to "normal C", especially in its simplicity, which is often undervalued. If C was easily fixable it probably would've been done already anyway...
- bondant 1y agoDo you know if there are some professional games that have been made with Odin and released on steam or on game consoles?
- karl_zylinski 1y agoI (the author of the article) also made a kooky game called CAT & ONION: https://store.steampowered.com/app/2781210/CAT__ONION/ https://store.steampowered.com/app/2781210/CAT__ONION/ It's a short game made in Odin, but I spent a lot of effort in polishing it so that it would be a pleasant little strange experience. It was the first commercial game made in Odin. Some games made by other people: Solar Storm (turn-based artillery game): https://store.steampowered.com/app/2754920/Solar_Storm/ https://store.steampowered.com/app/2754920/Solar_Storm/ 2deez (fighting game, not yet released): https://store.steampowered.com/app/3583000/2Deez/ https://store.steampowered.com/app/3583000/2Deez/
- ghfhghg 1y ago