A Zig Christmas: No Hidden Allocations Under This Tree! ⚡ | Advent of Languages Day 21

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 4

  • @bnolsen
    @bnolsen 15 днів тому +1

    One big strength of zig is the simplicity and power of its build chain. just downloading a zig package would be enough and you wouldn't need to bother with unnecessarily wrapping everything in a docker file.

    • @MrJakob
      @MrJakob  15 днів тому

      I didn’t know that. Just wanted to get get going quickly for the video, therefore I decided to quickly spin up a docker container. Will definitely take a better look at all of zigs features in the future, when there is more time. Thanks for the hint.

  • @Ansatz66
    @Ansatz66 17 днів тому

    It is nice to have so much control over allocation, but I can't imagine willingly choosing to give up all the sophisticated features of Rust. I am pretty sure that even in Rust you can control how memory is allocated. I don't actually know how that works in Rust because I have never had reason to care how memory is allocated. I cannot imagine what sorts of applications would make Zig preferable over Rust.

    • @MrJakob
      @MrJakob  17 днів тому

      I am not really fond of explicitly declaring every allocation like that either and Rust definitely has some amazing features. You make some good points about Rust's memory control capabilities. However zig is an interesting language which has its merits. Maybe for example in embedded firmware for time-critical systems where you'd want to know exactly when and where allocations happen - though I don't actually know if anyone is doing this with zig. In the end I guess it comes down to personal preference and style. There are times when I really enjoy writing c, because I am feeling even closer to the bare metal of the machine. Haven't done enough with zig yet to develop the same feeling, but I can see why some developers might be interested in it as an alternative, even with Rust being available.​​​​​​​​​​​​​​​​