Live data from Hacker News

I like Odin

hasenjudy.wordpress.com

11–20 of 211 posts

Re: I like Odin

#11
post #3

It is not hard to design a language which is a "better C than C" because C has obvious warts, the article mentions a few. But the warts just aren't big enough to justify switching to a different language. That's why no "better C than C" has ever become really popular.

Simple is not easy. The devil is in the details.

Many people can try. It's not easy to do a good job at it.

Re: I like Odin

#12
I think the reason why he is liking Odin, as a person who used Go, is because it's arguably an offshoot language of Go. Odin (https://odin-lang.org/docs/overview/) has borrowed a lot from Go, which can be easily detected in various syntax and concepts.

Another language which is in both the C and Go alternative language category, is Vlang (https://github.com/vlang/v/blob/master/doc/docs.md). For anybody that has used Go, these are definitely languages to check out and would be easier to learn.

Re: I like Odin

#13
I have high hopes for Odin. There has been a recent trend of C/C++ replacement languages like Zig,Rust,V, etc. with each one trying to find its niche and triumph over its competitors.

Odin's niche is the kind of high performance programming that's done in games and other real time visualization applications.

Other than fixing C's known issues, like having proper tagged unions, fixing macros, and the crazy compilation model among others, it has a bunch of features, that make it appeal to game programmers.

Features, such a structure of arrays support for data oriented design, builtin support for matrices, vectors, and shader-like syntax for 3D math, allocators and the like.

And it certainly doesn't hurt that unlike many of these upstart languages, Odin has a real, successful, commercial product built in it, EmberGen, which is used for CG smoke and flame simulations:

https://jangafx.com/software/embergen/

Re: I like Odin

#14

Odin Homepage: https://odin-lang.org/ (I was curious) I can't see this being generally successful unless it can interoperate with existing C code without much effort. Update: It appears it can: https://odin-lang.org/docs/overview/#foreign-system It apparently targets LLVM.

I recently wrote a bindings generator to Odin for my C libraries, and the FFI is very well thought out, down to defining things like linker dependencies in the code. For instance see here:

https://github.com/floooh/sokol-odin/blob/main/sokol/gfx/gfx...

The only minor downside (compared to Zig) is that Odin still requires a separate C/C++ toolchain to actually build the C dependencies. But I guess that's a typical 1st-world-problem ;)

(however AFAIK Odin's FFI system isn't in any way related or depending on LLVM).

Re: I like Odin

#15
What happens when you mutate the target of a pointer to the same memory as the target of an "immutable" reference (eg. function parameters and union switches)?

Re: I like Odin

#16
post #2

> As someone who is interested in systems programming, and has experience working with Go I wonder how Go got it's reputation as a systems language. Imo, it occupies the same abstraction level as Java or C#.

I agree with the others. Go is its own abstraction level.

Not powerful enough to be compared to Java.

Probably closer to Node.js, that's to say, it is like JavaScript in the server. Judging by the developers who use it. Except it is compiled.

Re: I like Odin

#18
post #12

I think the reason why he is liking Odin, as a person who used Go, is because it's arguably an offshoot language of Go. Odin ( https://odin-lang.org/docs/overview/ ) has borrowed a lot from Go, which can be easily detected in various syntax and concepts. Another language which is in both the C and Go alternative language category, is Vlang ( https://github.com/vlang/v/blob/master/doc/docs.md ). For anybody that has u…

In terms of actual features though (ignoring trivial syntax), Odin resembles more of Jai. In fact, when I first found about it a few years earlier I though it was an open source clone of Jai.

Today many features have diverged since then, and Odin is ahead by many aspects (mainly that the compiler is open source, but also that it’s already being used in production via EmberGen). I still really want the full metaprogramming capabilities that Jai has though (which is lacking in Odin currently).

Re: I like Odin

#19
A small but (IMHO) very neat detail is the Pascal-style syntax for defining variables (without requiring a separate 'var' or 'let' keyword):

    // inferred type:
    a := 23

    // explicitly typed, the type is squeezed between the : and =
    a : u32 = 23
OTH constants now require special syntax:

    a :: 23
...but at least this is consistent with other places in the language, like functions:

    my_func :: proc(...)
...and 'squeezing in the type' also works as expected for constants (which admittedly looks a bit weird, but is also hardly needed):

    a : u32 : 23
Post reply on HN