Carbon, the latest programming language to be built within Google, was unveiled today as an experimental successor to C++.
[…]To that end, while Carbon has many of the same goals as Rust, such as helping developers to create “performance-critical software,” Carbon is also intended to be fully interoperable with existing C++ code. Additionally, the goal is to make migrating from C++ to Carbon as easy as possible, if desired.
This is not my area of expertise, so I’ll leave it to you readers to say more interesting things. The code for Carbon – not entirely sure about the name, but alright – is on github, along with more information.
Would be interesting to compare with https://vlang.io/ aka https://github.com/vlang/v/
Agreed, I love playing around with v it’s a great innovation as is Rust, I’ll be keen to see what Carbon offers, I’m not a fan of Go.
Touting any as replacements for c, or c++ might be a stretch for any languages, and the advent of things like OpenAI is going to make it even less likely, when a bot can plough the internet and deliver a c or c++ coded solution to a plain language question. To me that is a huge hurdle for any new language to overcome, because it’s the huge library of work that has come before that sets the framework, not the promise of things that can come.
V is compatible to C.
And nearly all languages can integrate libraries with functions written and compiled in C.
And nearly all languages can create libraries, which functions can be used in C.
Thats the reason, why there are more bindings for more languages for GNOME and GTK+ then for KDE and Qt.
( And doesn’t compile V to C? So it creates not its own binaries. It only compiles to C, So it isn’t a surprise, that it is compatible to C. )
Other languages can not easiely access objects and classes, which are written in C++.
So, I think Carbon will be the first one, which can do it. So no bindings are needed.
theuserbl,
And it’s not just different languages that can have trouble with C++ objects, even C++ compilers have different calling conventions that make their binaries incompatible with each other.
https://sourceforge.net/p/mingw/mailman/mingw-users/thread/BAY143-DS3B09800DE993A271B1E6EDF720%40phx.gbl/#msg20086642
https://stackoverflow.com/questions/52713849/why-does-gcc-ignore-attribute-stdcall
For better or worse extern ‘C’ is often the easiest way to address these incompatibilities by using C bindings even with C++ projects. You end up loosing classes and namespaces that give C++ an advantage over C.
The programming world clearly needs a better standard for APIs, but it’s damn hard to replace C when it’s been the dominant defacto standard that nearly all compiled languages have to adhere to for compatibility. I expect it will remain the greatest common divisor of all languages for the foreseeable future.
Regardless of what carbon is technically capable of, it won’t be google’s intentions but rather the embrace or rejection of it by the programming community that will determine if it can become a succeeding standard.
What would bring up another language ? Would everyone switch to it ? https://www.explainxkcd.com/wiki/index.php/927:_Standards
Kochise,
C will continue being the standard for APIs. Languages have to be compatible with it, not because C deserves this status, but because it was there first and doesn’t use the same starting line.
That’s the thing with popularity contests. Things become less about merit and more about the network effects. Like most incumbencies C is propelled by sheer popularity despite the problems it causes.
There are already plenty of successors to C++. Is this another C-like object-oriented language with all the “problematic features” ripped out and a whole new standard class library?
One of my first thoughts was “Does it support older versions of macOS? I’m sure some people will want to target Carbon from Carbon.”
Oh yeah, I forgot about this one, thank for the reminder.
Before reading the blurb, my first thought was to wonder why Google was moving to MacOS when they are so heavy into Linux. Then I had to wonder how a business based on search algorithms would choose a name that would be so hard to search for. “programming carbon” and “carbon language” are going to bring up a lot more Apple resources than Google resources.
Wonder what the interoperability will be between Carbon and Rust? Will it be analogous to C++ and C?
Not really. 2003 was 20 years ago.
And the amount of activity in Carbon for MacOS has been minuscule since then.
“2003 was 20 years ago.” – Time’s running fast these days, but not _that_ fast :D.
Again a successor for C++ ?
At first it was Java.
Then C#. (Which have a preprocessor)
And D.
And Rust.
And Googles own language Go.
Carbon’s syntax looks a little bit like Java and Scala.
But hopefullly it is now really 100% compatible with C++.
That means, it is easy to write Qt applications in Carbon?
Can you write Qt application using Carbon that target the Carbon environment on MacOS X?
Carbon disappeared a long time ago on macOS
I see the same set of issues from google coding as I see in Microsoft!
Embrace the existing. Extend the methodology. Extinguish the old system.
I wish mega-corps would stop messing around with the backbone of tech. The C family is too important to have any aspect locked down by one company.
Every attempt to go it alone (D, E, G, V, Carbon, etc) creates some variation that as a source package is one more headache for the user.
From the little I have read this language is more like Swift. While there are other C++ successors they can’t easily use existing C++ code. They need to use bindings using the C ABI as an intermediary step (extern “C”) and/or foreign function interfaces like JNI that are not trivial Meanwhile in Swift you can directly use a class written in Objective C and if I understand correctly this is the objective with Carbon.