4 ms·
1) When I programmed in C++ I was using Vim and the YouCompleteMe plugin for IDE-like features. Now I use Vim + CTags. For CTags I use the following which uses
by unique_id 8y ago
1) When I programmed in C++ I was using Vim and the YouCompleteMe plugin for IDE-like features. Now I use Vim + CTags. For CTags I use the following which uses the Zig standard library to parse Zig code: https://github.com/isaachier/ztags https://github.com/isaachier/ztags. In the future there will be support for the Language Server Protocol.
2) I git pull every few days to run on the latest compiler. The bugs that I've hit have been minor inconveniences, nothing serious. I think Andrew would agree with you though that Zig is probably too immature for a serious project at this point. The transition to the self-hosted compiler has yet to take place, that compiler is in its infancy.
3) I'm afraid that my verbal inability will never do Zig justice. The built in slices and optionals are really nice. Pointers are non-null by default (but can be undefined). Stack traces on crashes. Much better casting in my opinion (once I got used to it). Error handling that's similar to Herb's C++ deterministic exception proposal. No headers. Not having to decide between fast compile times and comfortable printing. Defer statements instead of destructors or nothing work really well in my opinion. Built in testing (maybe not something you use much in gamedev). +% means add with overflow, + means overflow is undefined. Everything feels nicer, that's as good as I can put it.
edit: You can Ctrl+F "pub fn" to browse all public functions. Great when browsing Github. It's easy to grep for the definition of anything. Overflow and other undefined behavior is detected in debug mode, this saves me so much time. Guaranteed inline is nice. No more make/cmake and manually listing which files to compile.
- keldaris 8y agoThank you for the detailed responses. One, possibly silly, followup question, since you mentioned using AVX. If I understand correctly, Zig deliberately avoids macros, metaprogramming and doesn't have operator overloading. Given those limitations, how do you deal with vector math over different SIMD widths without insane verbosity? I feel like I'd be tempted to write a simple code generator before starting on something like that.
- unique_id 8y agoZig has extensive metaprogramming support. For SIMD I'm using ispc which is a shader-like language/compiler from Intel. You write your code from the point of view of a single SIMD lane and the compiler takes care of the rest. Intel kind of screwed the project over with their stupid naming and terrible website but it's a very cool project. I take the resulting object file and link it with the rest of the project. This is very different from trusting a compiler to vectorize your code, with a shading language you know it's going to vectorize. What's absolutely brilliant is when you start to use divergent control flow and see how well it handles it. https://pharr.org/matt/blog/2018/04/18/ispc-origins.html https://pharr.org/matt/blog/2018/04/18/ispc-origins.html