by Sphax on 5/27/22, 9:16 AM with 97 comments
by SkeuomorphicBee on 5/27/22, 12:57 PM
(A bit off topic rant, but Zig documentation is quite bad, it took me a lot more effort that it should to discover the facts above.)
[1] https://ziglang.org/documentation/master/#Anonymous-List-Lit...
[2] https://ziglang.org/documentation/master/#Anonymous-Struct-L...
by codethief on 5/27/22, 10:43 AM
by curist on 5/27/22, 12:49 PM
by longrod on 5/27/22, 9:58 AM
How's the Language Server support for this? Last time I tried ZLS, it was quite well rounded so I am curious to know if this type annotations would work with it or not. Would be really cool if they do.
I have never been able to fully adopt zig due to how frustrating working with strings is but I absolutely loved the comptime functionality.
by nickysielicki on 5/27/22, 2:01 PM
* arbitrary file I/O. I can take my compile time data and write a python script to put it in a std::array, but I shouldn’t have to.
* non-fixed-sized containers, ie vector
* a generic memoization utility in the standard library for caching. If I want my function to handle any input at runtime, but I want to pre-populate a cache at compile time for values that I know will be called, it’s doable but not as easy as it should be. (In general, given the amount of algorithms that rely on memoization, I’m somewhat surprised that Python is the only language I know that makes memoization as easy as a decorator).
by jhgb on 5/27/22, 2:35 PM
by voigt on 5/27/22, 2:21 PM
Great work of the author explaining comptime!
by noodledoodletwo on 5/27/22, 12:04 PM
I can't figure out why i am supposed to care about zig beyond it's fun? I get that it's interesting and more safe than C (honestly though what the hell isn 't).
Say you write rust pretty regularly for new product development, what does zig offer to make my life better, my products more stable, etc?