• mox@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    It would be nice to include Zig’s approach in the comparison. I’ve only just begun learning it, but the syntax seems pretty elegant from what I’ve seen so far.

    Upvoting not because I share author’s preference, but because I’m interested in reading other people’s perspectives on the topic.

    • thingsiplay@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Read my reply with a handful of sea salt. I just read tutorials and documentation a bit and did Hello World.

      Zig is pretty cool too! It can run C code directly just like C++ does (I think), kind of drop in replacement. From my reading so far, Error Handling is kind of a marriage between Go’s and Rust’s Error handling. Actually pretty cool. It has Error Types, but is kept relatively simple and doesn’t force to do all the stuff. It has Try and Catch keywords to handle errors elegantly, but don’t be fooled, this has nothing to do with Try…Catch blocks for Exceptions. Zigs Try and Catch are more like Rusts Result type handling, at least from what I read so far.

      I lean more towards Zig than Go, but it still has not reached stable 1.0 release.