Author here. I always get asked two questions about libCello.<p>1. Why?
2. Is anyone using it for anything serious?<p>The second one is easiest to answer: no. And most people are suprised to hear that I probably wouldn't use it for anything serious either.<p>If you hadn't noticed from my github page I love C, and while I am also very interested in the things Cello adds such as duck typing and interfaces, and all the syntactic sugar that makes thing really nice and literate; it doesn't interest me enough to choose it over C. Additionally who is going to want to use my project if it uses this weird hacky C library! People are (for good reason) very suspect of dependancies.<p>That isn't to say I don't like programming in Cello. I'm almost definitely the person who has written the most in it and some things are just a joy to write in it, and look so clear and functional and algorithmic. At some point in the distant future when I find the time I really will attempt something serious such as a web framework. If that takes off we seriously can decide if it really is a good project (hur hur hur).<p>To be fair, "why" can also be pretty easy to answer depending on who is asking: because I could. Because I thought it was kinda cool and that people would be interested. There seems to be some default position in programming that unless your project is silly or sarcastic people assume you are "advocating" something by doing it, or making some kind of political statement on software development. I didn't work on this project to try and change the world. Nor to create something better than the alternatives. It doesn't change my life if people use Cello or not. I wasn't frustrated with C++, and I wasn't looking for a cylindrical rolly thing for my cart. I just made it for fun.
Previous discussion: <a href="https://news.ycombinator.com/item?id=6047576" rel="nofollow">https://news.ycombinator.com/item?id=6047576</a><p>This has tons of sugar; if you're just interested in how this stuff is possible in C it would probably be more instructive to look at the GNU library libffcall[0] which implements trampolines. The code is simpler and there's less syntactic sugar obscuring what's going on. Of course, the linked articles on the Cello home page are instructive too.<p>I've yet to actually use Cello myself since I feel like if you hack C up that much, you might as well just use something like C++, C#, Rust or what have you and gain even more benefits, like a mature ecosystem that's highly compatible with the features you're using while I worry Cello, when relying on normal C libraries, might require you to slip back into some C-isms that Cello desires to avoid due to your dependencies not caring.<p>[0]: <a href="https://www.gnu.org/software/libffcall/" rel="nofollow">https://www.gnu.org/software/libffcall/</a>
I really love this. Are there convenience functions to convert existing values to and from your new data types?<p>I would love to use this library but as C programs often requires third-party libraries I could see many instances of having to use normal C types. Is there a way, for example, to easily convert a float to and from a var (with a Real key/value)? How would I use your library to take hash table values and assign them back into standard struct members? Would I just use traditional casting? Something tells me normal casting is not an option, or at least not so easy.
I see lots of weird comparisons here.<p>I think the most apt would be a comparison to Vala, which is compiled to C and also adds higher level languages features.<p>That said, Vala is much heavier, and requires manual writing of interface files to use C libraries.<p>I can see this being a useful tool if kept lightweight. It's certainly prettier than GObjects!
Has the development moved away from github[1] or has it completely stalled ? The last commit I see is from 8 months ago.<p>[1] <a href="https://github.com/orangeduck/libCello/" rel="nofollow">https://github.com/orangeduck/libCello/</a>
> To compile Cello requires a C99 compatible C compiler.<p>In fact, it fails to compile with -std=c99, it seems to require GNU extenstions, that's why they have -std=gnu99 in their Makefile. They use ##__VA_ARGS__, which is not in the C99 and AFAIK there is no portable way to make a workaround.
Too high level IMHO... $(Int,5) is not reasonable, also everything is too opaque for it to be a C library. You can go a long way without creating such a layer of abstraction with just a set of libs implementing data structures, dynamic strings, with simple object-alike structures that are reference counted so that it is trivial to have lists of hashes or alike, but where you can also store raw stuff trivially just changing the "method" to free or dup the objects.<p>EDIT: AFAIK "$" is not valid ANSI-C, however I would love it... For example in a reference counting system could be cool to have $() and _() to incr/decr references.
The syntax is rather reminiscent of jQuery... and just like how that has created jQuery developers who know next to no JavaScript, I could envision many Cello developers who know almost no C which given the characteristics of the language would probably be an even bigger problem. It's good that they have a disclaimer saying that this isn't for those who don't already know C.<p>I think it's more like a framework than a library, based solely on the principle that it basically encourages a completely different syntax and code style that someone else would have to learn in addition to C in order to work with code written using it.
It would be very interesting to pair this with a very well designed minimalistic web framework, drivers for things like Redis, etc., for some <i>VERY</i> high-performance web backends.
Let C be C. For the people who don't like C for one reason or another, there are a ton of alternatives available, from x64/x86 targeting languages to manages stacks. Adding these libraries to C might look nice, but if you want to experience the things it brings to the table use a language where it's been borrowed from.
After seeing this I started work on a simplification of libCello called Viola [0]. It has a slightly lighter syntax and takes away some (IMO) needless typing...<p><pre><code> [0] https://github.com/eatonphil/Viola</code></pre>
> /* Heap objects destroyed with "delete" */<p>> delete(items);<p>This part is funny: "Higher Level" but still no garbage collection.