Live data from Hacker News

Zen-C: Write like a high-level language, run like C

github.com

121–130 of 159 posts

Re: Zen-C: Write like a high-level language, run like C

#125
post #21

So, 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…

I wonder, how can a programming language have the productivity of a high-level language ("write like a high-level language"), if it has manual memory management? This just doesn't add up in my view. I'm writing my own programming language that tries "Write like a high-level language, run like C.", but it does not have manual memory management. It has reference counting with lightweight borrowing for performance sensi…

It has autofree and drop traits.

Re: Zen-C: Write like a high-level language, run like C

#126
post #34
post #21

So, 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…

There are going to be lots of languages competing with Rust and Zig. It's a popular, underserved market. They'll all have their unique angle.

Uhm, no? There is barely enough space for Rust, which happens to have a unique feature/value proposition that raises it above the vast majority of its competitors. If you're fine with UB or memory unsafe code, then you go with C simply because its deeply entrenched.

In that sense Zen-C changed too many things at once for no good reason. If it was just C with defer, there would have been an opportunity to include defer in the next release of the C standard.

Re: Zen-C: Write like a high-level language, run like C

#127
post #119
post #95

Earlier quoted context omitted.

It might or might not be a toy project, I'm not sure, but one advantage of subtracting the borrow checking is that the compiler avoids a lot of complex machinery. Borrow checking in Rust isn't sound AFAIK, even after all these years, so some of the problems with designing and implementing lifetimes, region checking, and borrow checking algorithms, aren't trivial.

> Borrow checking in Rust isn't sound AFAIK, even after all these years Huh? If borrow checking in Rust is unsound, that's akin to saying Rust is utterly broken. Sounds like you've been fed FUD. If Rust was that unsound, Rust haters would flood Twitter with Rust L takes.

Not just that, it would also mean that every single Rust application is riddled with very noticeable miscompilation bugs due to the fact that Rust makes heavy use of strict aliasing rules for optimization. This isn't something that can easily be sweeped under the rug without people noticing.

Re: Zen-C: Write like a high-level language, run like C

#128

Earlier quoted context omitted.

"immutable variable" is an oxymoron. Just because Javascript did it does not mean every new language has to do it the same way.

I think you are confused by terminology here and not by behavior, "immutable variable" is a normal terminology in all languages and could be says to be distinct from constants. In Rust if you define with "let x = 1;" it's an immutable variable, and same with Kotlin "val x = 1;"

Lore and custom made "immutable variable" some kind of frequent idiomatic parlance, but it’s still an oxymoron in their general accepted isolated meanings.

Neither "let" nor "val[ue]" implies constancy or vacillation in themselves without further context.

Re: Zen-C: Write like a high-level language, run like C

#129

Earlier quoted context omitted.

"immutable variable" is an oxymoron. Just because Javascript did it does not mean every new language has to do it the same way.

“Immutable” and “variable” generally refers to two different aspects of a variable’s lifetime, and they’re compatible with each other. In a function f(x), x is a variable because each time f is invoked, a different value can be provided for x. But that variable can be immutable within the body of the function. That’s what’s usually being referred to by “immutable variable”. This terminology is used across many differ…

Probably variable is initially coming out of an ellipsis for something like "(possibly) variable* value stored in some dedicated memory location". Probably holder, keeper* or warden would make a more accurate terms using ordinary parlance. Or to be very on point and dropping the ordinariness, there is mneme[1] or mnemon[2].

Good luck propagating ideas, as sound as it might, to a general audience once something is established in some jargon.

[1] https://en.wiktionary.org/wiki/mneme [2] https://www.merriam-webster.com/medical/mnemon

Re: Zen-C: Write like a high-level language, run like C

#130
post #105

Earlier quoted context omitted.

C is literally a high level language.

Seriously, in the discussion happening in this thread C is clearly not a high-level language in context. I get your statement and even agree with it in certain contexts. But in a discussion where high-level languages are presumed (in context) to not have memory management, looping constructs are defined over a semantics inferred range of some given types, overloading of functions (maybe even operators), algebraic dat…

glad you bring up context in this note. i find C high level too but u are right, in a comparisson you can still say its really low level.

C was coined originally as high level because the alternatives were things like assembler. a term rooted in comparisson more than anything.

Post reply on HN