I’m currently suffering a dilemma and I’m considering using Odin over Rust.

I was hoping for friendly and positively constructive assessments of which language and why from anyone who wishes to answer?

  • @dragonfly4933@lemmy.dbzer0.com
    link
    fedilink
    English
    182 months ago

    To be honest, I never heard of it, and it is interesting, but the language isn’t the only factor, it’s the ecosystem as well. It says it’s an alternative to C, so I will just assume it can consume C libraries. But that still leaves you with using C libraries, which is not a great position to be in if you are looking to not use C.

    If you are looking for something that is actually in use, but not rust, look into Zig. Still would need to use a lot of C libraries, but it at least looks like it has momentum. Not to mention they seek to completely replace libc, which would actually be useful and an achievement, since that is the biggest problem C actually has.

    I am a rust fan myself, but if you are new to programming it’s not a great place to start due to its’ learning cliff.

    • Fluffy HubOP
      link
      fedilink
      English
      12 months ago

      I love me some C, not C++ just C++. That isn’t to say C++ is a bad language, i just prefer the vanilla experience. I picked Rust for it’s expressive syntax and ergonomic approach to programming, also ofc the safety and the fact as a solo dev i cannot afford a quality assurance team to review my code.

      I’m familiar and good at Rust. I know the syntax and can read and write it with easy but, there as some instances where Rust can be a pain. For instance quick prototyping. Rust can sometimes feel like i’m working on Rust not my engine.

      Hence the Odin idea. I like the guy Ginger Bill who made it and although maybe not as performant as Rust it is simple and concise. I did investigate Zig but Zig feels like it’s a mess to be quite honest, that doesn’t mean i dislike or to any Zig fans i like it but it’s just not my cup of tea.

      Also having to use Miri with Rust can make everything feel weird as Rust’s borrow checker has cases not found in other languages.

    • Fluffy HubOP
      link
      fedilink
      English
      22 months ago

      Hobby game engine, i’m debating if Odin being a quick, simple and performant language would help me get my idea from in my head into RAM

      • @sudo@programming.dev
        link
        fedilink
        22 months ago

        Game engines seem to be explicitly what Odin was built do. I’m just reading their website for the first time but they make that clear.

        My impression of Odin is that its explicitly made to enable you to write unsafe code. But that’s good if you want to get some crazy optimizations going through.

      • @IsoSpandy@lemm.ee
        link
        fedilink
        02 months ago

        For any other use case, I would have recommended Rust, but for making a hobby game engine, I would advise not using either rust or Odin and instead use C and C++. The graphics drivers have a primary C Abi and you would spend a really long time debugging C to Odin/Rust translation layer bugs than actually working on he engine.

        I would suggest write a C rendering library, wrap it in safe Rust and move on from there.

        • Fluffy HubOP
          link
          fedilink
          English
          32 months ago

          I already know C/C++, I love them but I never use them again. Rust’s borrow checker is still active in unsafe Rust, combined with Miri it detects most UB, leaks and various other problems. For instance I’m building a allocator now in Rust and i know it compiles and Miri didn’t complain, sure i can do it in C and use Valgrind but Rust makes it a dream.

          I know for Odin there are 3 tools i was looking at which could validate it for UB and leaks at runtime, but what attracts me to Odin is the fact it’s not OOP and simple. I’m considering using it because i will be more debugging my game, rather than the language (to quote Zig).

          But all that being said I’m good with Rust and it’s tooling, so I’m probably going to remain with Rust. But yours and everyone’s opinions is helping me form this so thank you!!

    • Fluffy HubOP
      link
      fedilink
      English
      52 months ago

      I think you might be correct. I’ve decide to build a hobby game-engine, as i was signed off from work with limited (if any chance of return), so i definitely have the time to do this and make some measurements. Good idea thank you

      • @Chewt@beehaw.org
        link
        fedilink
        22 months ago

        This is just my take, but a game engine could be a really cool way to see how far you can take Odin. As a new language, I don’t think there are many complex projects using it.

  • @MajorHavoc@programming.dev
    link
    fedilink
    0
    edit-2
    2 months ago

    I’ve never heard of Odin, and I don’t know anyone being paid to write code in Rust.

    Source: I hire and mentor professional programmers.

    Edit: I assumed you were picking for breaking into the field, but I see from your other replies that this is for a hobby project. For my hobby projecs, I use whichever amuses me.

      • @MajorHavoc@programming.dev
        link
        fedilink
        2
        edit-2
        2 months ago

        It’s better than writing C, Java or Cyton.

        I believe you!

        Edit: But you all can probably still pry C from my cold dead hands someday, lol. C is a perfectly cromulent language, for my purposes.

      • @MajorHavoc@programming.dev
        link
        fedilink
        2
        edit-2
        2 months ago

        Thanks for the counterpoint.

        I always worry about the kids breaking in running after the next hot thing, and then not landing a job, because I’ve talked to folks who did so.

        I was needlessly worried, as they’re picking for a hobby project, anyway.

        And as someone else pointed out, Rust is on its way up. I just wouldn’t recommend Rust to a newbie as their first language to land their first job, today.

    • @hitwright@lemmy.world
      link
      fedilink
      22 months ago

      For a language constantly voted as most desired for x number if years in a row (stackoverflow survey), there are now quite a few developers actively working with Rust full-time and paid. I think it’s in top 20 languages by now.

      • @MajorHavoc@programming.dev
        link
        fedilink
        22 months ago

        there are now quite a few developers actively working with Rust full-time and paid.

        Yeah. I didn’t mean to imply otherwise. But quite a few doesn’t always cut it to break into the field.

        But my concern was entirely misplaced as they’re picking for a hobby project anyway.

      • @MajorHavoc@programming.dev
        link
        fedilink
        2
        edit-2
        2 months ago

        It’s certainly growing fast. And yeah, tops the desired charts.

        Python did that for years, and is now at number 4 (after the big three JavaScript, SQL and HTML).

        I, too, see great things in the future for Rust.

        I also agree, Rust is likely top 20, but it feels (from hjobs search anecdotes from peers) like there’s a massive drop off in real world use after the top 8 or 10.

        But again, my concern was entirely misplaced, as they’re not picking their first break-into-coding language, anyway.

  • Fluffy HubOP
    link
    fedilink
    English
    12 months ago

    TLDR; I chose Rust. Thanks.

    Hello everyone. I just wanted to update everyone on the result of my deliberating on Odin, Zig and Rust.

    After a long time thinking it over. It has become clear that to me in personal opinion that Rust will be the best choice.

    Both in terms of the compiler keeping me a solo dev producing correct code. Without the requirement for a Quality Assurance team. And also i know it really well and languages such as Odin and Zig are fantastic and I am advising my son to learn game-dev with Odin.

    However, ultimately for producing quality reliable machine code. I feel that Rust is a better choice than Odin or Zig.

    Thanks to everyone who commented and helped me find the decision i was looking for <3

  • One of my acquaintances has actually made a small game in Odin (Cat and Onion) and after that written a book about the language (Understanding the Odin Programming Language). I don’t know much about Odin myself but from what I’ve gathered there isn’t that much quality documentation or that many good tutorials etc. so it can be a bit hard to get in to the language, which is why he decided to write the book.

    • Fluffy HubOP
      link
      fedilink
      English
      12 months ago

      I’m reading his book to get up to speed on Odin as we speak

  • @Kissaki@programming.dev
    link
    fedilink
    English
    32 months ago

    You’re already considering it; try it out.

    Exploration and prototyping is not a life-commitment that excludes other options later (like going back to Rust after all).

  • @kartoffelsaft@programming.dev
    link
    fedilink
    52 months ago

    As someone who’s used both, I’d have a strong preference for Odin over Rust if it were at a stable 1.0 release. As it stands now (or, at least, when I used it), Odin is very much in flux. Spend enough time with the language, and you’ll either find a bug with the compiler or the semantics will change after you update.

    That said, it would be my favorite without those problems. It is a really simple language in a good way. There’s no fancy language features that are just syntax sugar (well except maybe context, but I find that to be actually convenient). You can understand everything in an afternoon if you are already familiar with programming in other languages. Rust is pretty much the opposite in all of these reguards.

    Rust also has the benefit of being pretty recognizable at this point, so if you say your project is in Rust then people will know what that means, unlike Odin. More “resume-able” in a way.

    So, in short:

    • Odin if you’re doing it as a hobby
    • Rust if you want something “real”
    • Fluffy HubOP
      link
      fedilink
      English
      12 months ago

      I agree Odin is simple which is why I’m drawn to it, after all i know computer science so really i don’t need a prescribed away to do something like in Rust. Rust is amazing, but it can be slow to develop in, the points is in the compiler as for a solo dev, it reduces my need for a code quality team. Odin just gets out the way and let’s you get going, it’s also Go like which i’m familiar with. I’ve been slowly planning to stick with Rust, i might help my son learn Odin though <3

  • @bitcrafter@programming.dev
    link
    fedilink
    52 months ago

    You should seriously consider using Odin if you happen to be writing code on a Wednesday and you want additional divine blessing.