News for hackers. Stuff that matters.
Re:Learning C3 by tiniuclx on Thursday May 29, 2025 @10:46AM (#44126634)
This looks promising, but I wonder what advantages it has over Rust. Community support is very important for a programming language, and given that this is the first time I am hearing about this project, it still has some way to go.

Edit: ABI compatibility & two way interop with C seems to be a pretty big selling point!

Re:Learning C3 by fn-mote on Thursday May 29, 2025 @11:03AM (#44126794)
I want to second this comment.

The comparison shouldn't be with C, it should be with C++, Rust, or Zig.

The place to go is actually the C3 comparison page:

https://c3-lang.org/faq/compare-languages/

There you can see that there are very few items "in C3 but not Rust", for example. Mainly "it's a familiar C-like language".

I am also suspicious of the macro system. I'd like more of an explanation of how it works. Especially how it relates to Zig comptime, and whether it has "hygiene" problems. Hygiene to me means: can a variable name in a macro expansion refer to a variable outside of the macro? (The concern is that this could be accidental.)

https://c3-lang.org/generic-programming/macros/

Re:Learning C3 by lerno on Thursday May 29, 2025 @01:54PM (#44128462)
All macros are hygienic. However, you can pass in a lazy expression which then is evaluated in its original context.

The macro cannot insert variables into the caller scope, nor cause the function to return. Mostly it's similar to a static inline function with optionally polymorphic arguments. But it can do some more things as well, but nothing violating hygiene.

Re:Learning C3 by sph on Thursday May 29, 2025 @02:42PM (#44128937)
The comparison is with C because C3 wants to be “C, but better”. Rust doesn’t have that design goal, it doesn’t look like an incremental update to C and it’s more akin to C++ in philosophy (with an ML-inspired syntax)

There is a space for a C alternative, and Rust ain’t it.

Re:Learning C3 by synergy20 on Thursday May 29, 2025 @11:02AM (#44126790)
Rust is way more complex to say the least, in fact it's the sole reason why it still has the same market share as COBOL(https://www.tiobe.com/tiobe-index/). Rust 1.0 was released 10 years ago by the way.
Re:Learning C3 by metaltyphoon on Thursday May 29, 2025 @11:08AM (#44126837)
Tiobe really?
Re:Learning C3 by dgb23 on Thursday May 29, 2025 @11:40AM (#44127139)
I don't 100% understand. Do they really just look at search engine stats?

https://www.tiobe.com/tiobe-index/programminglanguages_defin...

That seems like it's a potentially interesting signal, but the index implies that it is about adoption.

Looking at the index, it seems like Python has a 2.5x higher rating than C and Java. While I assume that Python is a widely adopted language, this feels wrong in many ways.

But given that they just look at search engine stats, one can explain the higher rating, because Python is often used by novice programmers and tech workers who are not primarily programmers/SWEs.

Re:Learning C3 by garbagecoder on Thursday May 29, 2025 @11:55AM (#44127308)
OK, so show us your source that shows Rust has higher uptake.
Re:Learning C3 by leadingthenet on Thursday May 29, 2025 @06:12PM (#44130890)
Re:Learning C3 by hu3 on Thursday May 29, 2025 @06:32PM (#44131023)
Rust jobs: 0.04

Python jobs: 0.9

Seems about right, maybe.

Except there's no way PHP (0.09), Ruby (0.07) and Go (0.1) are on the same magnitude as Rust jobs.

So this site doesn't pass the sniff test for me.

Re:Learning C3 by garbagecoder on Wednesday June 04, 2025 @01:33PM (#44183307)
So it just must be the case that Rust has more jobs because that smells right to you? Even compared to Go which has found a nice niche in networking?

If Rust is as good as its evangelists say it is, we won't have to worry about how the stats smell, we'll see it, and it won't rely on some "Cnile" conspiracy to keep it down either.

Re:Learning C3 by steveklabnik on Wednesday June 04, 2025 @02:22PM (#44183857)
I think you've got the parent backward: they're saying that Rust "should" have far less jobs than these other technologies.

If your parent is wrong, happy to be corrected. I thought it was interesting that we read the post in completely opposite ways, and I think both readings can be accurate. I based my reading on a vague remembering that I think the parent isn't a fan of Rust, which is fuzzy and also may be wrong!

Re:Learning C3 by mahmoudimus on Thursday May 29, 2025 @11:21AM (#44126941)
I hate on Tiobe as well but it is a good benchmark for world wide adoption commercially.
Re:Learning C3 by orangeboats on Thursday May 29, 2025 @11:45AM (#44127193)
TIOBE is an especially poor benchmark if the programming language community is not highly reliant on general-purpose search engines like Google.

Take into consideration that most Rust programmers rely on https://docs.rs etc rather than Googling something.

Re:Learning C3 by dymk on Thursday May 29, 2025 @11:24AM (#44126957)
It's basically just the number of Stack Overflow questions / Google hits there are about a language, it's a pretty poor benchmark
Re:Learning C3 by joshring2 on Thursday May 29, 2025 @01:04PM (#44127991)
Community support in C3 is massive, as you can use C libraries directly, it might parallel or exceed Rust on that metric, and the barrier to adding native C3 wrappers or versions is significantly lower too.

Rust is solving a different problem, that of safety over all else. C3 on the other hand is more akin to developer experience above all else.

If you find something that should be easier to do in C3, that's a bug.

Re:Learning C3 by dymk on Thursday May 29, 2025 @02:04PM (#44128572)
Is massive really the right word to use here? I’ve never heard of C3, meanwhile most big tech companies are hiring Rust developers of some sort.
Re:Learning C3 by lerno on Thursday May 29, 2025 @01:51PM (#44128427)
Rust is a C++ competitor with all the semantic complexity that comes with it. And similar compile times.

C3 is more complex than C (because of a net increase of features), but it's miles from C++ and Rust in complexity and it compiles as fast or faster than C.

Re:Learning C3 by vram22 on Thursday May 29, 2025 @03:20PM (#44129303)
How does C3 compared to C in runtime performance?
Re:Learning C3 by lerno on Thursday May 29, 2025 @03:32PM (#44129415)
I based the LLVM-IR output on what Clang outputs for C. And so they should be identical. C3 has a single module option for maximum interfunctional optimizations, but Clang can give you LTO for the same thing.

So they should be the same, otherwise it's a bug.

Re:Learning C3 by vram22 on Thursday May 29, 2025 @07:06PM (#44131259)
thank you.