Live data from Hacker News

Cello – A library that brings higher level programming to C

libcello.org

151–158 of 158 posts

Re: Cello – A library that brings higher level programming to C

#151
post #147

Earlier quoted context omitted.

In C you would only use void pointers very occasionally, to work around the lack of generics/templates in data structures. Most of the time, objects have types. In Cello, everything is a void pointer. Limited as it is, compiler type checking in C is still valuable.

Static typing gives types to expressions (in the program text), not to objects (at runtime).

I'm not sure what you mean by objects at runtime. Can you elaborate? The sort of objects I interact with at runtime are typically typed structures, so I guess I don't understand your statement.

Re: Cello – A library that brings higher level programming to C

#152
post #114
post #102

How about performance? As I understand, it uses fat pointers fat pointers and GC, so performance drop is expected. There are not many reasons to use C nowadays beside performance.

> There are not many reasons to use C nowadays beside performance. portability? stable ABI? ... writing something in C make it easy for any other higher level language to link to it. That's why we're not done with C, at all ... it's basically the only serious language out there used to share code among every possible platform or language. Even C++ which is a bit safer in practice is harder to link. I just wished C wa…

There are many languages with excellent C ABI compatibility with nearly the same portability, as well as some languages that compile down to C, while offering more safety and productivity.

So aside from performance and legacy codebases, there's no huge incentive to start a project in C these days. I think those who do it, do it in spite of the alternatives out there.

Re: Cello – A library that brings higher level programming to C

#153

Earlier quoted context omitted.

> without any real improvements (aside from GC). You've really gone down the rabbit hole if you think GC is an improvment

Automatic memory management is an improvement. I prefer region-based memory management to GC but a GC is a godsend in, for example, dynamic languages where you don't want any restrictions, or functional programming where you're pretending to program for a machine with infinite memory.

It is certainly not an improvement for a systems language

Re: Cello – A library that brings higher level programming to C

#154
post #99

Earlier quoted context omitted.

There's literally not a single comment in this thread comparing C to Rust, and yet Rust fanatics are the ones derailing here? Care to elaborate, my good friend?

No idea where the GP got 'rust' from this is about Iron. You know.

Agreed, and "Iron", which, according to frostirosti, "doesn't totally enforce type safety", doesn't describe Rust in the slightest, so it almost feels like anyone projecting Rust evangelism from that comment must be talking out of their ass. You know. :)

Re: Cello – A library that brings higher level programming to C

#155
post #151

Earlier quoted context omitted.

Static typing gives types to expressions (in the program text), not to objects (at runtime).

I'm not sure what you mean by objects at runtime. Can you elaborate? The sort of objects I interact with at runtime are typically typed structures, so I guess I don't understand your statement.

Objects are runtime entities. They are created and manipulated when the program is running.

Re: Cello – A library that brings higher level programming to C

#156
post #121

As a superstitious C programmer, typedefing (void star) feels like walking on the cracks in the pavement, crossing the path of a black cat, walking under a ladder, or squeezing a lemon under the full moon to me. These kinds of tricks seem very clever at first but there always comes a point when they start to break down. I'd be leery about using union in 2017, but typedefing (void star) is like putting on your underpa…

I'm not super familiar with Cello (and I'm not sure I get the point of it overall, are there that many platforms left that you can target from C but not C++?) but in its defense it does seem to implement fat pointers and runtime checks to have a degree of type safety. Not sure how thorough it is but it's not just decaying everything to void pointers behind the scenes. It's a pretty clever hack though, like using setj…

Do you use Python in production? It uses setjmp for its exception handling.

Re: Cello – A library that brings higher level programming to C

#157
Here's the author of Cello talking about the project at PolyConf in 2015: https://www.youtube.com/watch?v=bVxfwsgO00o

« In this talk I dig into the depths of my programming library Cello - a fun experiment to see what C looks like when pushed to it's limits. I'll cover how Cello works internally, some of the cuter tricks used to make it look and feel so different, what is in store for future versions of Cello, and why it is important to push languages to their boundaries. »

Re: Cello – A library that brings higher level programming to C

#158
post #114

Earlier quoted context omitted.

> There are not many reasons to use C nowadays beside performance. portability? stable ABI? ... writing something in C make it easy for any other higher level language to link to it. That's why we're not done with C, at all ... it's basically the only serious language out there used to share code among every possible platform or language. Even C++ which is a bit safer in practice is harder to link. I just wished C wa…

There are many languages with excellent C ABI compatibility with nearly the same portability, as well as some languages that compile down to C, while offering more safety and productivity. So aside from performance and legacy codebases, there's no huge incentive to start a project in C these days. I think those who do it, do it in spite of the alternatives out there.

> There are many languages with excellent C ABI compatibility with nearly the same portability

Which ones?

Post reply on HN