Why not compile to rust or assembly? C seems like an odd choice. In fact why not simply write rust to begin with?
Assembly requires way more work than compiling to, say C. Clang and gcc do a lot of the heavy lifting regarding optimisation, spilling values to the stack, etc
Zen-C: Write like a high-level language, run like C
31–40 of 159 posts
Re: Zen-C: Write like a high-level language, run like C
#32Re: Zen-C: Write like a high-level language, run like C
#33Am I the only one who saw this syntax and immediately though "Man, this looks almost identical to Rust with a few slight variations"?
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.
Re: Zen-C: Write like a high-level language, run like C
#34So, 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
#35Earlier quoted context omitted.
I thought the same and felt it looked really out of place to have I8 and F32 instead of i8 and f32 when so much else looks just like Rust. Especially when the rest of the types are all lower case.
Agreed, that really stood out as a ... questionable design decision, and felt extremely un-ergonomic which seems to go against the stated goals of the language.
Re: Zen-C: Write like a high-level language, run like C
#36 repeat 3 {
try { curl(...) && break }
except { continue }
}
...obviously not trying to start any holy wars around exceptions (which don't seem supported) or exponential backoff (or whatever), but I guess I'm kindof shocked that I haven't seen any other languages support what seems like an obvious syntax feature.I guess you could easily emulate it with `for x in range(3): ...break`, but `repeat 3: ...break` feels a bit more like that `print("-"*80)` feature but for loops.
Re: Zen-C: Write like a high-level language, run like C
#37So, 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…
Nim is a high-level language as well and compiles to C.
Re: Zen-C: Write like a high-level language, run like C
#38Re: Zen-C: Write like a high-level language, run like C
#39Why not compile to rust or assembly? C seems like an odd choice. In fact why not simply write rust to begin with?
Re: Zen-C: Write like a high-level language, run like C
#40An 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?
i think so. The biggest hurdle with new languages is that you are cut off from a 3rdparty library ecosystem. Being compatible with C 3rd party libraries is a big win.