3 ms·
I want to second this comment. The comparison shouldn't be with C, it should be with C++, Rust, or Zig. The place to go is actually the C3 comparison page: h
by fn-mote 1y ago
I want to second this comment.
The comparison shouldn't be with C, it should be with C++, Rust, or Zig.
The place to go is actually the C3 comparison page:
https://c3-lang.org/faq/compare-languages/ https://c3-lang.org/faq/compare-languages/
There you can see that there are very few items "in C3 but not Rust", for example. Mainly "it's a familiar C-like language".
I am also suspicious of the macro system. I'd like more of an explanation of how it works. Especially how it relates to Zig comptime, and whether it has "hygiene" problems. Hygiene to me means: can a variable name in a macro expansion refer to a variable outside of the macro? (The concern is that this could be accidental.)
https://c3-lang.org/generic-programming/macros/ https://c3-lang.org/generic-programming/macros/
- lerno 1y agoAll macros are hygienic. However, you can pass in a lazy expression which then is evaluated in its original context. The macro cannot insert variables into the caller scope, nor cause the function to return. Mostly it's similar to a static inline function with optionally polymorphic arguments. But it can do some more things as well, but nothing violating hygiene.
- deleted 1y ago[deleted]
- sph 1y agoThe comparison is with C because C3 wants to be “C, but better”. Rust doesn’t have that design goal, it doesn’t look like an incremental update to C and it’s more akin to C++ in philosophy (with an ML-inspired syntax) There is a space for a C alternative, and Rust ain’t it.