Zen-C: Write like a high-level language, run like C
21–30 of 159 posts
Re: Zen-C: Write like a high-level language, run like C
#22Am I the only one who saw this syntax and immediately though "Man, this looks almost identical to Rust with a few slight variations"?
Re: Zen-C: Write like a high-level language, run like C
#23Earlier quoted context omitted.
It seems to just be Rust for people who are allergic to using Rust. It looks like a fun project, but I'm not sure what this adds to the point where people would actually use it over C or just going to Rust.
> what this adds I guess the point is what is subtracts, instead - answer being the borrow-checker.
There is an entire world in Rust where you never have to touch the borrow-checker or lifetimes at all. You can just clone or move everything, or put everything in an Arc (which is what most other languages are doing anyway). It's very easy to not fight the compiler if you don't want to.
Maybe the real fix for Rust (for people that don't want to care), is just a compiler mode where everything is Arc-by-default?
Re: Zen-C: Write like a high-level language, run like C
#24An interesting bit to me is that it compiles to (apparently) readable C, I'm not sure how one would use that to their advantage I am not too familiar with C - is the idea that it's easier to incrementally have some parts of your codebase in this language, with other parts being in regular C?
Re: Zen-C: Write like a high-level language, run like C
#25So, the point of this language is to be able to write code with high productivity, but with the benefit of compiling it to a low level language? Overall it seems like the language repeats what ZIG does, including the C ABI support, manual memory management with additional ergonomics, comptime feature. The biggest difference that comes to mind quickly is that the creator of Zen-C states that it can allow for the produ…
Re: Zen-C: Write like a high-level language, run like C
#26Re: Zen-C: Write like a high-level language, run like C
#27List of remarks:
> var ints: int[5] = {1, 2, 3, 4, 5};
> var zeros: [int; 5]; // Zero-initialized
The zero initialized array is not intuitive IMO.
> // Bitfields
If it's deterministically packed.
> Tagged unions
Same, is the memory layout deterministic (and optimized)?
> 2 | 3 => print("Two or Three")
Any reason not to use "2 || 3"?
> Traits
What if I want to remove or override the "trait Drawing for Circle" because the original implementation doesn't fit my constraints? As long as traits are not required to be in a totally different module than the struct I will likely never welcome them in a programming language.
Re: Zen-C: Write like a high-level language, run like C
#28Re: Zen-C: Write like a high-level language, run like C
#29Initial commit was 24h ago, 363 stars, 20 forks already. Man, this goes fast.
Could be bots.
Re: Zen-C: Write like a high-level language, run like C
#30Why not compile to rust or assembly? C seems like an odd choice. In fact why not simply write rust to begin with?
[flagged]
Is this suppose to be a positive thing? I thought we all wanted to violently murder the patricians.
Regardless, C might be a valid IR. I apologize for being bigoted.