3 ms·
I've never used Zig or C++, mostly Bash, Python, and Lisps, but have recently began learning C. I see C++ in search results, and it looks like C with higher lev
by LanternLight83 3y ago
I've never used Zig or C++, mostly Bash, Python, and Lisps, but have recently began learning C. I see C++ in search results, and it looks like C with higher level features in a register that reminds me of Java. I see this, and it looks similer: C with higher level features that remind me more of Python. I'm sure it's got other important features and priorities that set it apart (oft' discussed here), but that's what I see, and I dig it.
To be clear there are definitely a few ideoms I'd need to learn before considering this readable (it ain't psudocode), but I generally see all the building blocks and recognize what they're achiving. Maybe I'd have put them together slightly differently, but that could be equally true in Python. I'd rather learn this next than C++.
The density of how it's been written reminds me of some lisp code I've read, some implementations of state machines can be hard to follow too (in the classic "but where does it do the thing?" sense). I attribute a lot of the stuff that I don't follow to the lower-level C influence; I'm working for the first time with memory managment, structs, static types, pointers, bitwise opperations, etc.
Think I made my point in there somewhere >z>
Would love to know where you're coming at it from, I'd imagine that the C or 'kinda functional control flow' aspects might explain what looks most forign to you too (unless you have broader experience with low level languages)?
- lionkor 3y agoYoure mostly right, but Zig is not higher level than C. In some ways, its lower level, as in C the allocator you use is mostly abstracted away, while in zig its usually required to be specified.