Learning C3
41–50 of 163 posts
Re: Learning C3
#42After using Rust on a couple of projects, I understand the appeal of simpler languages like C3, Zig, and Odin. As one commenter very aptly put on the Zig subreddit ... "I used Zig for (internal tool) because I wanted to quickly write my tool and debug it, and not spend all my time debugging my knowledge of Rust."
Is Zig really that common at this point that you'd feel comfortable using it for a work project? Its not just going to piss off the next person and have them need to rewrite it? I guess Rust has the same problem to some extent but there is a lot of resources for writing Rust out there now
Re: Learning C3
#43a bit down the page there is stuff on the case syntax. The fact that "you can't have an empty break" is a good choice, but the fact that having two cases do the same thing has syntax
case X:
case Y:
is footgun waiting to happen. I would strongly suggest the authors of C3 make stacking cases look like this: case X, Y:Re: Learning C3
#44Most of these features have been used by countless C++ developers for the past decades -- I really don't see the point in adopting a language that's mostly C++ but without some of the warts. Either pick C++ or something like Rust.
Re: Learning C3
#45Most of these features have been used by countless C++ developers for the past decades -- I really don't see the point in adopting a language that's mostly C++ but without some of the warts. Either pick C++ or something like Rust.
Re: Learning C3
#46a nitpick: a bit down the page there is stuff on the case syntax. The fact that "you can't have an empty break" is a good choice, but the fact that having two cases do the same thing has syntax case X: case Y: is footgun waiting to happen. I would strongly suggest the authors of C3 make stacking cases look like this: case X, Y:
Re: Learning C3
#47> Don't misunderstand me - I love using foreach in other languages; the added syntax better expresses your intent, reducing logic errors. It did jump out at me as "this isn't C" though. Because it's not. The whole point of C is that you know exactly what's going on and it's relatively clear in the code itself. C++ hides logic in abstractions for the sake of convenience. This is a C++ thing. How does it know how to it…
Re: Learning C3
#48a nitpick: a bit down the page there is stuff on the case syntax. The fact that "you can't have an empty break" is a good choice, but the fact that having two cases do the same thing has syntax case X: case Y: is footgun waiting to happen. I would strongly suggest the authors of C3 make stacking cases look like this: case X, Y:
seems subtle to distinguish between case 3,4: for values 3 or 4, and case (3,4): for an array with the value [3,4]
Re: Learning C3
#49https://github.com/jckarter/clay/wiki/Clay-for-C---programme...
Re: Learning C3
#50Earlier quoted context omitted.
There's also Zig in the C-alternatives space. https://ziglang.org/
There is also Odin: https://odin-lang.org/ Would be nice to have a list of these and comparisons
C23 got typeof, constexpr constants, enums with underlying type, embed, auto, _BitInt, checked integers, new struct compatibility rules, bit constants, nullptr, initialization with {}, and various other improvements and cleanups. Modern C code - while still being simple - can look quite different than what people might be used to.
C2Y already already got named loops, countof, if with declarations, case range expressions, _Generic with type arguments, and quite a lot of UB removed from the core language. (our aim is also to have a memory safe subset)