Recent submissions

Comment · 19 days ago
The C backend is still experimental and far from ready for prime time, so it's not unexpected!
Comment · 19 days ago
Comment · 1 month ago
Comment · 1 month ago
<> is the worst choice for generic syntax in a language with C-like syntax. It's not surprising that it was introduced by C++. It is very ambiguous.

Some short examples: `foo<1> * a` – is this `(foo < 1) > (a)` or `(foo<1>) a`? What about `foo<1>>2>a`? Is that `(foo<1> > 2) > a` or `foo<(1>>2)> a`?

Just horrid.

Comment · 1 month ago
Or `cast{int*}(myage)`
Comment · 1 month ago
It works visually poorly with things like `int*(ptr)` and `int[2]*(arr)` though.
Comment · 1 month ago
The C3 temp allocator leans into this though. It’s not a frame allocator but acts like a stack allocator. It solves the ”oh, how do you make sure the data you got back is properly freed”. In Zig you need to create and free arenas by hand, which is not far from freeing the returned allocations by hand.

But I think C3 shows it can be taken further.

Comment · 1 month ago
Zig, for better or worse, have a strong messaging and isn’t afraid of making big claims. That they don’t always pan out (”faster than C”, ”colorless async” etc), doesn’t matter. Zig was the first C alternative to spring from the interest Jon Blow ignited with his language dev and that marketing lead has been superbly well maintained by Andrew.

Odin and C3 has at least a magnitude fewer people knowing about them. More modest claims, less marketing potential.

So for D, it was to my memory never sold as a silver bullet either. A better C++ certainly, but with enough humility to not market itself as some game changer.

Compare Zig, V and Rust marketing with D’s and you’ll see what I mean.

Comment · 1 month ago
I believe all examples are derived from C++ examples on its new reflection capabilities.
Comment · 1 month ago
C3 has an even simpler way than Zig: `Color.RED.description`.

From what I can see the example started from C++, and then comparing how each language would look building it in userland instead.

Comment · 2 months ago
Yes, lesson learned.
Comment · 2 months ago
TLDR; people think that a "C-alternative" means "used for what C is used for today". But that's not what the C alternatives (except for Zig) try to achieve.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton