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)
Cello – A library that brings higher level programming to C
91–100 of 158 posts
Re: Cello – A library that brings higher level programming to C
#92Earlier 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.
Re: Cello – A library that brings higher level programming to C
#93Earlier 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.)
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
#94Why 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 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
#95Earlier 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…
Re: Cello – A library that brings higher level programming to C
#96Re: Cello – A library that brings higher level programming to C
#97Earlier 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.
Re: Cello – A library that brings higher level programming to C
#98What features make it "higher level"? It looks like syntactic sugar on C code 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
#99Earlier 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.