▲ | ManBeardPc 3 days ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comptime is very nice but certainly more limited then Lisp. You can't generate arbitrary code with it. But good enough to implement something like JSON serialization or Struct-of-Arrays in normal code that is readable. Custom allocators are very nice. We are very much in manual memory management + optimization territory here. Having things like arena allocators makes a lot of difference in specific use-cases when you want/need every bit of performance. Also nice being able to switch the allocator for tests that is able to report leaks for example. Yes, hidden control flow I mean something like exceptions, RAII or Rust's Dispose. So more a comparison to other languages than C. The explanation I would refer to the talks "Don't forget to flush" or "Zig Roadmap 2026" from Andrew Kelley. Also the blog post "Zig's New Async I/O". I think it has something to do with being able to infer the required size of the stack, but already forgot the details. https://kristoff.it/blog/zig-new-async-io/ https://youtu.be/f30PceqQWko?si=g2nLTE4ubWD14Zvn https://youtu.be/x3hOiOcbgeA?si=SUntYOYNOaxCRagc&t=3653 As to compared to Rust. The fast compile times are nice. Having a small language that you actually can understand helps to be productive. Not being restricted by the borrow checker makes it easier to implement some low-level things. Just being able to import most C code without wrapper makes the smaller ecosystem a much smaller problem. Rust is nice and certainly a good pick for many cases, but personally I often feel overwhelmed by the complexity and tons of tons of types for everything. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | taminka 2 days ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
> Yes, hidden control flow I mean something like exceptions, RAII or Rust's Dispose. So more a comparison to other languages than C. C has macros, which is the ultimate form of hidden control flow, where a symbol can expand to any arbitrary code... also hidden allocations and functions that can error, which you could argue isn't traditionally understood as hidden control flow, but it's still nice to know when stuff is allocated and/or can create an error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | rowanG077 3 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rust dispose? I think you mean drop. But I don't see how that is hidden control flow. It's very clear when it drop is called. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|