Live data from Hacker News

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

github.com

51–60 of 159 posts

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

#51
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 sensitive parts: https://github.com/thomasmueller/bau-lang

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

#52
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.

I has been served for several decades, however since the late-90's many decided reducing to only C and C++ was the way going forward, now the world is rediscovering it doesn't have to be like that.

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

#53
post #36

The whole language examples seem pretty rational, and I'm especially pleased / shocked by the `loop / repeat 5` examples. I love the idea of having syntax support for "maximum number of iterations", eg: 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 sh…

Ruby has a similarly intuitive `3.times do ... end` syntax

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

#54

Earlier quoted context omitted.

Could be bots.

It’s not, it’s just how hackernews works. You’ll see new projects hit 1k-10k stars in a matter of a day. You can have the best project, best article to you but if everyone else doesn’t think so it’ll always be at the bottom. Some luck involved too. Bots upvoting a post not organically I doubt is gonna live long on first page.

The stars are on GitHub, they can come from somewhere else, e.g. the author himself buying stars.

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

#55

Syntax aside, how does this compare to Nim? Nim does similar, I think Crystal does as well? Not entirely sure about Crystal tbh. I guess Nim and Vala, since I believe both transpile to C, so you really get "like C" output from both.

man I haven't heard anything about Vala in ages. is it still actively developed/used? how is it?

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

#56

Earlier quoted context omitted.

It’s not, it’s just how hackernews works. You’ll see new projects hit 1k-10k stars in a matter of a day. You can have the best project, best article to you but if everyone else doesn’t think so it’ll always be at the bottom. Some luck involved too. Bots upvoting a post not organically I doubt is gonna live long on first page.

The stars are on GitHub, they can come from somewhere else, e.g. the author himself buying stars.

This is hella common. Companies have too much money to spend.

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

#57
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.

They're are certainly going to be lots of languages because now with LLMs it's easier (trivial?) to make one + library (case in point: just within last month there're have been posted here ~20 new langs with codebases 20k~100k LOC) but don't really see them competing. Rust and Zig brought actual improvements and are basically replacing usecases that C++/C had limiting the space available to others.

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

#59

Syntax aside, how does this compare to Nim? Nim does similar, I think Crystal does as well? Not entirely sure about Crystal tbh. I guess Nim and Vala, since I believe both transpile to C, so you really get "like C" output from both.

I was also going to mention this reminds me of Vala, which I haven't seen or heard from in 10+ years.

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

#60

> Mutability > By default, variables are mutable. You can enable Immutable by Default mode using a directive. > //> immutable-by-default > var x = 10; > // x = 20; // Error: x is immutable > var mut y = 10; > y = 20; // OK Wait, but this means that if I’m reading somebody’s code, I won’t know if variables are mutable or not unless I read the whole file looking for such directive. Imagine if someone even defined custo…

Yeah, immutability should probably use a `let` keyword and compiler analysis should enforce value semantics on those declarations.
Post reply on HN