top | item 43941785

(no title)

bsrkf | 9 months ago

Seems needlessly harsh and also misplaced in some way. Zig is super non-ergonomic to any C-developer, and its explicitness at all costs is also non-C-like (meaning a rather big shift for someone actually liking C). Rust is a completely different beast altogether.

Odin is a rather simple, performant, pragmatic, procedural language, fixing especially things in C with regards to its type system and infrastructure (such as packages), adding niceties such as `defer` while being at it. I, as a C programmer, have it far higher up my list of languages to try than Zig or Rust by a rather large margin.

btw: "C alternative means a language that will last for 50 years" seems a snide that could be applied to any language less than 20 years old? I'm not sure what that's concretely meant to criticize here? Is Zig more a 50-year language than Odin, if so how? Odin is used for rather serious commercial products at JangaFX btw: https://jangafx.com/ and is quite beloved by some people using it.

discuss

order

James_K|9 months ago

I have long been aware of that particular user of Odin, after all the creators mention it frequently. The fact remains that the US government has warned against the use of languages such as Odin [1]. As such, it is competing in the extremely small niche of "languages best suited for embedded computing and operating systems". Suffice to say that most of its users likely do not use it for that. Finally there is the matter of trust. A while ago I was shopping around these new languages that have sprouted out of LLVM and watched a few talks from the creators of various languages. The Zig team were both ambitions and clear in their presentation. They gave me the impression of an experienced and motivated team. By contrast the Odin presentation I saw was utterly directionless and filled with fluff. I like to think I have a good nose for BS, and Odin trips it. That great wall of random corporate logos of companies which don't use Odin on their website doesn't help. Upon investigating, I find that the creator of the language is also a developer at JangaFX, so is either using the Odin website to advertise his own software, or hoping to obtain clout by mentioning large companies as if they used Odin when they do not. You might think I'm being overly critical, but I've learned the hard way to avoid things like this. It's a mighty pain depending on something which ends up abandoned or unused. The Zig compile supports multiple codegen backends, compiling C/C++ code, and easy cross-compilation. It is a considerable feat of engineering and shows a lot of dedication on the part of the creators. I can see nothing comparable on the Odin front.

Additionally, I don't think a C replacement should be immediately intuitive to someone who has only ever used C. To entice people away from on of the most popular and stable programming languages ever created, you must offer more than an incremental improvement. There needs to be a paradigm shift, which necessitates some degree of learning on the part of the developer.

[1] https://techtheworld.net/2024/03/06/the-nsa-list-of-memory-s...

masfoobar|9 months ago

Just curious - which Odin talk are you referring to that shows it as "directionless anf filled with fluff"

Also the company logos on the website are under "Companies who use products by JangaFX" but it probably should be in its own section.

drannex|9 months ago

> The fact remains that the US government has warned against the use of languages such as Odin

That goes for Zig as well. But, the NSA is only classifying based on most well-known languages, and additionally a lot of those aren't 'memory-safe' they just have GC, the reason they don't believe you should use C is because they don't have built in memory safety checks at all, whereas Odin does. They have Pascal on that list, which is a primary inspiration of Odin, and is also technically an unsafe language.

> By contrast the Odin presentation I saw was utterly directionless and filled with fluff.

I am not sure why a presentation has anything to do with performance or credibility of a language, plus I am always impressed by their talks. Good chance you saw their live coding/development sessions? They live stream development fairly often.

> I like to think I have a good nose for BS, and Odin trips it.

Odin is used in production, hard production today. I use it to run 6000+ retail locations doing embedded automation work in security, it's highly proficient and accessible. There is no BS here, everything has been defined and they are honest about their shortcomings when there are those (which are minimal).

> The Zig compile supports multiple codegen backends, compiling C/C++ code, and easy cross-compilation.

That's because they bundle the entirety of LLVM in their builds, they didn't do a lot of extra work for C/C++ code compilation, they just built an alias (with a set of internally defined better default flags) to the clang compiler, it's just a passthrough.

re: cross-comp: Odin is in the same boat, both Zig and Odin compile out to assembly via LLVM, they can reach the same targets practically.

> That great wall of random corporate logos of companies which don't use Odin on their website doesn't help

They do use Odin, they use JangaFX, that is less a 'this is a code written by these companies' (which some do send upstream changes, so they do) and more of a declaration of "We are used in production in these companies, you have likely ran Odin code in your favorite games, or seen in your favorite movies". That's fairly obvious for any tech-oriented project or company, especially for a language.

> Additionally, I don't think a C replacement should be immediately intuitive to someone who has only ever used C

Again, automation systems architect for one of the largest companies in the world here, I have people who have never even _programmed_ writing proficient code to use in production (after checks, of course). As an embedded developer, its insanely intuitive to C developers, and anyone who has ever programmed.

---

Check out the language, write some code, try it out, seriously, I was on the fence when I first heard about it several years ago, I think you might enjoy it. If you're not an LLM chatbot, then you might even find it invigorating to try something new. Doesn't hurt, and you learn some new things.