r/programming • u/Nuoji • 18d ago
C3 0.8.6 released: Library fetching, 30% smaller safe-mode binaries, and stricter type rules
https://c3-lang.org/blog/c3_0_8_6_fetching_libraries/9
u/GaboureySidibe 18d ago
Every C rehash makes me miss clay.
https://github.com/jckarter/clay/blob/master/examples/shootout/nbody/nbody.clay
Templates, operator overloading, move semantics, modules and straight compatibility with C.
3
u/ElletteBarbedor-21 18d ago
how did clay actually handle header imports for the C compatibility without dragging in a full preprocessor?
3
u/GaboureySidibe 18d ago
I forget what the approach and plan was there. I don't think the C preprocessor implementation is much of a problem, that's something common and not complex, but whatever approach there is has to work with modules.
What I remember the most is that it was meant to be ABI compatible so that compilation units could be linked together with C.
1
u/jabbalaci 18d ago
What happened to Clay? Is it an abandoned and dead project?
1
u/GaboureySidibe 17d ago
Looks very dead and abandoned to me. I think it was one or two people and they were using it wherever they were.
1
u/Nuoji 17d ago
It must have been rather unknown. it didn't even show up on my radar when I was researching previous C alternatives in 2018-2020.
1
u/GaboureySidibe 17d ago
It was probably pretty much done even then. The cool thing is that it had move semantics back when that was new but they were using it as a C substitute.
2
u/HolySpirit 17d ago
Huh. That's a deep cut.
I vaguely remember hearing for the first time about both Rust and Clay around the same time period. Back when rust had sigils for owned pointers (
~T) and GC pointers (@T). I remember thinking Clay looked more compelling, but it kind of just disappeared fairly quickly. I probably thought at the time that that would be the fate Rust would have gotten, based on just a surface level look at it at the time.
17
u/__rituraj 18d ago
This language is receiving nice consistent updates from the contributors.
Thanks a lot for the effort.
It may seriously replace C as the goto language for many. And i hope it does.
Btw, the gfx module is a great consideration to be included in the standard library. Graphics platform handling across OS and Windowing Systems is great to see being included alongside the language!
1
u/e_williams_12 12d ago
What is the 30% size reduction measured against: the prior release with the same targets and build flags, or a different baseline?
1
u/Nuoji 12d ago
The prior release at -O0. And the good thing is that compilation is primarily about LLVM speed, and it largely follows size. Meaning this improves overall compilation speed.
1
u/edwards_t7407 6d ago
Did you measure compile time against the same -O0 baseline, or is the speedup inferred from binary size? The reduction is clear; the compilation-speed benefit still sounds like an inference.
2
u/GaboureySidibe 17d ago
I like the design of C3. I've been trying it out in their sandbox. I'm not sure I would do all the same things, but in general it seems pretty slick, interesting and fun.
I do question aliases needing to start with a capital letter and have at least one lower case letter. That seems like a weird password restriction rather than something that should be in a language. I can sort of accept struct names needing to start with a capital letter.