Live data from Hacker News

Cello – A library that brings higher level programming to C

libcello.org

91–100 of 158 posts

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

#91
post #24

Earlier quoted context omitted.

What do you love about C and hate about C++?

C++ is very complicated. C is basically the simplest possible programming language, and the closest to the API actually presented by the processor (i.e., assembly language)

[deleted]

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

#92
post #87

Earlier quoted context omitted.

Cello and C++ are have very different design goals. Cello is essentially a dynamic language implementation on top of C, and uses runtime reflection in places where a C++ programmer would probably prefer compile-time template hackery.

Idiomatic C++ is not like Cello at all. But it still allows you to do all things that Cello does - and most of them wouldn't be macros then, but classes and overloaded operators on them.

Somehow I doubt C++'s built-in object system will allow you to create classes (yes, classes, not objects) and/or alter their vtables at runtime. (I know, vtables are an implementation detail. You still get the idea.)

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

#93
post #87

Earlier quoted context omitted.

Idiomatic C++ is not like Cello at all. But it still allows you to do all things that Cello does - and most of them wouldn't be macros then, but classes and overloaded operators on them.

Somehow I doubt C++'s built-in object system will allow you to create classes (yes, classes, not objects) and/or alter their vtables at runtime. (I know, vtables are an implementation detail. You still get the idea.)

Not anymore so than the C one - it's just as static.

The point is that building blocks that you get from C++ are higher-level even so - classes, operator overloading, template metaprogramming etc - which should make it possible to implement something like Cello with a lot less effort (and hacks).

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

#94
post #18

Why not just use C++?

That's like saying "Why not just use lisp?" to a python programmer. They're entirely separate languages (albeit it they do share some commonalities, but not as many as you might think). C is my main language and I dabble in C++. I really dislike C++. I love C. I welcome any efforts to add a bit of higher level functionality to C. I have no desire (ever) to switch to C++.

> That's like saying "Why not just use lisp?" to a python programmer. They're entirely separate languages

That's not really true now is it? Sure, C++ and C are separate languages but they have a common history and everyone knows that. One can write extensive programs that are valid for both C++ and C compilers. C isn't a true subset of C++ but for from many practical perspectives it is. In practice they have a common ancestor language that still can be (more or less) compiled with both compilers.

Lisp and Python however... they have no such common ancestor and the syntax are very different.

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

#95

Earlier quoted context omitted.

C is close to the hardware, yes. But simplest possible programming language? No way.

"Simple" was a poor choice of words as it doesn't capture what I mean. I meant "fewest possible abstractions over the underlying hardware". BF and Lisp are both much simpler than C, but don't fit what I was trying to get at, as they present a totally different abstraction that is actually quite different from the underlying hardware. (Actually, so is C, since assembly language is itself an abstraction and processors…

Like C, C++ doesn't force you in any way to have extra useless abstractions over the hardware. The rest of your team do (and C make this way harder).

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

#96

Earlier quoted context omitted.

C++ isn't strictly a superset of C! Which I always found crazy. Some C will not compile for C++.

Can you provide C code that will not compile with c++ compiler?

int* p = malloc(256);

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

#97
post #26
post #19

Earlier quoted context omitted.

C programmer here. Cello isn't really C. So as long as you're using something that isn't quite C, and you want an object model, I think "why not C++?" is a reasonable question.

Looks like C to be. Just some macros and function calls.

If someone showed me a sample of the code, out of context, I wouldn't have guessed it was C. Maybe Javascript (with the "var" declarations).

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

#98
post #54

What features make it "higher level"? It looks like syntactic sugar on C code without any real improvements (aside from GC).

> without any real improvements (aside from GC).

You've really gone down the rabbit hole if you think GC is an improvment

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

#99
post #66

Earlier quoted context omitted.

Who's being harmed?

Presumably, people who wanted to talk about Cello in this thread, not Rust, and are having the signal-to-noise ratio reduced by this derailing.

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?
Post reply on HN