Live data from Hacker News

Show HN: The C3 programming language (C alternative language)

github.com

151–160 of 192 posts

Re: Show HN: The C3 programming language (C alternative language)

#151

Earlier quoted context omitted.

>This is maybe more striking when comparing against C which was already very old and battle tested in 1989 when it was standardized. If you pick any of these languages you're accepting an unknowable amount of churn. C has plenty of issues too, even though it is very old, battle tested and standardized. (How about all the UB in C, for example?) That is why people are looking for C alternatives in the first place. >It…

Sure, as someone who got paid to write C for many years I can't disagree it has issues - after all I no longer write C. I chose to write Rust instead. The notable commonality of these "C alternatives" is that they are still moving targets and yet that wasn't mentioned.

True, C3 at least is one breaking release per year and between those there are non-breaking additions.

It's quite common for a project to pin to a stable version so this doesn't seem too unpredictable.

Re: Show HN: The C3 programming language (C alternative language)

#152
post #147
post #145

Earlier quoted context omitted.

No, there is an incomplete proposal for it here though: https://github.com/c3lang/c3c/issues/1451 What would you like to use it for?

I find it useful in lower powered systems without floating point hardware. It may be a feature whose time has passed but it still seems like there's both a case for it and probably an elegant design waiting. Imagine using it on a 6809 system for example. :)

You could still do it as a userland feature and implement add/sub/mult/div as methods on the type.

Re: Show HN: The C3 programming language (C alternative language)

#153
post #63

Earlier quoted context omitted.

> Zig bdfl himself accused vlang of committing fraud a while back. That was truly foul. On top of that, begged readers to give their money to Zig. Clearly some have no limits on what to say and do against other languages or to sell their language. That's why whatever bad things a creator or evangelist says about another language, people shouldn't just swallow, and instead take with a grain of salt and some skepticism…

> That was truly foul Is it because, as the leader of a language, he shouldn't be making "attacks" against other languages? Because, as far as V being a fraud, he was 100% correct.

How is V a fraud? Last time I checked, the compiler worked and I was able to write and run complex programs, although I did run into some bugs.

Re: Show HN: The C3 programming language (C alternative language)

#154
post #22

Earlier quoted context omitted.

As the author, let me add something beyond the comparison. Zig and Odin are very different languages, Odin is – as its slogan goes - "for the Joy of Programming". Zig on the other hand doesn't feel that this is a goal. From what I can tell Zig fans like to wrestle with the features of Zig to figure out how to fit their solutions within the constraints of the language. A mental challenge, similar to that of fighting t…

On ziglang.org the very first thing we advertise is: > Focus on debugging your application rather than debugging your programming language knowledge. Clearly, you think the language fails at this criteria (your subjective opinion). Please be honest and say that, rather than implying that it's not explicitly one of the core design principles of the language (objectively false).

a little good faith and a little less grump would go a long way. not the first, nor second time you’re being harsh on your peers for no apparent reason, reading shit into what they say in a most inhospitable way, presenting yourself as some clairvoyant into intentions of others. it’s just not healthy, man. no one’s attacking you or your precious visions here.

it’s not at all “clear” from the comment that the author thinks what you say he does. what was said in the original comment aligns well with zig’s “only one (obvious) way to do things” and its explicitness. other languages offer a much broader vocabularies, higher-level overlapping toolsets, while zig is much more constrained and requires the user to do the work herself, hence “Zig fans like to wrestle with the features of Zig to figure out how to fit their solutions within the constraints of the language”, which is an objective fact.

Re: Show HN: The C3 programming language (C alternative language)

#155
post #130

I think any system language going forward really needs three things: 1. Generics / templates 2. Destructors 3. Ownership It is unfortunate that this only has the first one. There was a language called clay that had all three and kept easy integration with the C ABI, but it seems like that design has been lost.

Destructors and Ownership implies RAII and all the design and architecture that are assumed with such things. This is far from C semantics, and so out of scope for C3. Any RAII language will be considered a C++ competitor, not a C alternative. None of Zig, Odin, C3 or Hare has RAII.

The problem is that C semantics leads to C problems that the world has dealt with for decades.

It sounds like you are leaving tried and tested simple advancements in programming on the table just to avoid a superficial comparison.

Even then what C++ people want from a competitor is simplicity. Not to give up the essentials but to keep the crucial aspects that they can never give up and are the reason they put up with all of the complexity of C++.

Re: Show HN: The C3 programming language (C alternative language)

#156
post #152
post #147

Earlier quoted context omitted.

I find it useful in lower powered systems without floating point hardware. It may be a feature whose time has passed but it still seems like there's both a case for it and probably an elegant design waiting. Imagine using it on a 6809 system for example. :)

You could still do it as a userland feature and implement add/sub/mult/div as methods on the type.

That never works as well as having it built into the compiler.

Re: Show HN: The C3 programming language (C alternative language)

#157
post #130

Earlier quoted context omitted.

Destructors and Ownership implies RAII and all the design and architecture that are assumed with such things. This is far from C semantics, and so out of scope for C3. Any RAII language will be considered a C++ competitor, not a C alternative. None of Zig, Odin, C3 or Hare has RAII.

The problem is that C semantics leads to C problems that the world has dealt with for decades. It sounds like you are leaving tried and tested simple advancements in programming on the table just to avoid a superficial comparison. Even then what C++ people want from a competitor is simplicity. Not to give up the essentials but to keep the crucial aspects that they can never give up and are the reason they put up with…

Personally I think it is reasonable that a C alternative is an alternative to C, and not a C++ alternative. C3 uses a temp allocator that removes a large number of cases where C++ would need RAII to manage memory. Did you try C3?

Re: Show HN: The C3 programming language (C alternative language)

#159
post #157

Earlier quoted context omitted.

The problem is that C semantics leads to C problems that the world has dealt with for decades. It sounds like you are leaving tried and tested simple advancements in programming on the table just to avoid a superficial comparison. Even then what C++ people want from a competitor is simplicity. Not to give up the essentials but to keep the crucial aspects that they can never give up and are the reason they put up with…

Personally I think it is reasonable that a C alternative is an alternative to C, and not a C++ alternative. C3 uses a temp allocator that removes a large number of cases where C++ would need RAII to manage memory. Did you try C3?

Does it just deallocate at the end of a scope? Why go halfway? It's obviously valuable and destructors are not complicated. Destructors can also close files, sockets, deallocate buffers from the GPU, etc.

I think when people want C semantics they will just use C in general, but if there is something that solves these extreme pain points in a simple way it might be enough to get someone to switch.

Re: Show HN: The C3 programming language (C alternative language)

#160
post #150

Earlier quoted context omitted.

all structs are namespaces (there no classes). namespaces may contain declarations (consts and functions) or fields ("fields" are slightly different for unions or certain builtins like arrays and slices) unions and enums also create namespaces. any @import creates a namespace that is a struct. If a function's first argument is the type of the function's namespace or a pointer to the type of the namespace, you may (an…

And you're saying that a modules are instances of structs? Meaning functions in modules are non-static methods?

modules are struct namespaces, so they create a compile time type.

modules (might not mean the same as module in any other given lang) ⊂ imports ⊂ structs ⊂ namespaces ⊂ types

Post reply on HN