Cello – High Level C
libcello.org
libcello.org
https://news.ycombinator.com/item?id=6047576
https://news.ycombinator.com/item?id=14091630
https://news.ycombinator.com/item?id=8799070
https://news.ycombinator.com/item?id=22102533
https://news.ycombinator.com/item?id=10526159
https://news.ycombinator.com/item?id=19665596
https://news.ycombinator.com/item?id=11912427
This shows up periodically and it looks pretty nightmarish (~15 years reading and writing C). If you want this kind of abstraction, I think you're better served by any of the dynamically-typed scripting languages.
This seems to be different enough you may as well just use another language.
I stumbled across this when a new chapter of crafting interpreters came out, and I ended up doing a deep dive into how to speed up CPython. My conclusion was that it wouldn’t be possible without rearchitecture of the fundamental types, and hence unpalatable, but a fun exercise none the lesser
If you’d be wrong to so quick to dismiss Cello. Cello is an order of magnitude quicker than python, even cython can only achieve 3x on CPython without annotation. The ideas behind Cello put it somewhere around JavaScript speed, but far more extendable, and definitely worthy of further investigation.
To expand further, fat pointers (void type, void data) could be superior to NaN boxing, and I’m not aware of any interpreted languages that have seriously implemented fat pointers, but it seems to be going well for Rust.
Have a look at PicoLisp. It has less than a handful of data types but i uses "Tag Bits". Julia is not really interpreted but it uses pointer tags for union types to save on boxing?
Sure, if you're going to do greenfield software development, and you don't absolutely need to kind of closeness to the metal (not just performance, but direct access) that C offers, then use something else (Rust, Zig, Go ... if you need to compile to native binaries, Java, C# & their myriad of variants if you don't).
But if you have to use C, to extend an existing project, use a specific library, or hook some other system... why not use Cello?
For sure, this is not a tight black-box abstraction, so you should strive to understand the semantics of how it works. Once you do though, it'll make your life a whole lot simpler.
I’m using it right now at work to build our firmware for our custom embedded board. It’s been brilliant: ESP-IDF is all C (mostly, some C++ but it all has C interfaces too) and wrapping, extending, calling and integrating into those has been a breeze.
In fact, today, I needed to be able to call the `esp_pthreads.h` functions (which describe some ESP32-specific extensions to it's pthread layer) and it took me, no joke, 5 minutes to wrap.
Pass the header through c2nim, add `{.importc, header: "esp_pthreads.h".}` pragmas to the proc definition, and done. Now I can call them without issue. Its liberating for sure!
That said, you can even wrap C++ if need be, though it's less elegant at times.
Seems to me, Cello would be more for those C programmers that didn't want to try the various alternative languages that are now out, and happen to agree with its developer's interpretation of preferred higher level abstractions and what they should look like. The point of these alternative languages is to offer features that C doesn't have or to implement them in easier or clearer ways.
I like V, nim, Zig, etc, but I just want a language that use the same idioms of C, with the same syntax flavor, without all the complexities of C++ (templates, inheritance, etc). I don't want complex, new features that new languages offer.
Vlang is the most simple in your list – it is a different syntax, but not much more complex than C.
From the next release you will be even able to import C into D. https://dlang.org/changelog/2.099.0.html#__import
But, I think all the macro magic in libcelli is a bit much.
The article shows it with syntax highlighting, that I could only guess wouldn’t actually work.
That said, people use C because it forgoes abstractions and complications. Neither C++ nor Rust provide that experience. I think Go comes the closest, while being a bit nicer to work with overall.
But at this point you know C++ pretty well (including all what you don't want to use, take a look at the CPP Core Guidelines), and using Rust is almost trivial, since Rust doesn't really introduce anything really new you wouldn't be already familiar with.
At least that was my experience.
https://github.com/michal-z/zig-gamedev
I like Raylib, and there are bindings for most popular languages, but I like the minimalism I can start with fairly quickly in Zig. I tried Bevy for Rust, but it is a lot more involved, and Rust, so Zig it is for now.
For safety, and high-integrity software, I am sticking with SPARK2014. Rust will get there soon, but Ada/SPARK2014 have such a lead, maturity, and industry take up that I am putting Rust down for another year or more.
Zig might be the most direct upgrade from C, but it seems like rust can mostly replace the entire concept of portable assembly, since it has zero cost abstractions.
C is not a language known for high security or reliability, nor is it known for being fast or easy to develop in, so by my guess based on vague anecdotal evidence, it seems that defaulting to the highest level of abstraction unless forced to do otherwise by some specific requirement is a better plan.
C and direct C replacements advertise simplicity, but if the simplicity doesn't buy you any reliability in practice, why bother with it?
There's almost no C code you could write in an effort to "forego abstractions and complications" that isn't also C++.
But although google has killed 264 projects so far [1], I believe that Go has too many dependents at Google and in industry to cancel. And even if it should happen anyway, the community will fork it.
FOSS projects die all the time. You might want to write a patch here and there, but do you want to do all the DevOps, pay for hosting, manage testing, etc?
Maintaining a project kinda sucks.
https://www.f-secure.com/en/consulting/foundry
https://developer.arm.com/solutions/internet-of-things/langu...
But also C isn't just for Intel, x86 and (some) ARM CPUs, there are other targets it has.
Any example with language extensions to ISO C, allows me to provide a counter example with language extensions.
Any example where only a subset of ISO C is allowed, allows me to provide a counter example with a language subset.
Sorry if I misunderstood it.