Google Engineers Lift The Lid On Carbon - A Hopeful Successor To C++
In addition to Dart, Golang, and being involved with other programming language initiatives over the years, [Google's] latest effort that was made public on Tuesday is Carbon. The Carbon programming language hopes to be the gradual successor to C++ and makes for an easy transition path moving forward.
The hope is that Carbon is a more natural migration path to C++ than the popular Rust programming language. Carbon aims for performance that matches C++, seamless bidirectional interoperability with C++, a easier learning curve for C++ developers, comparable expressivity, and scalable migration.
This discussion was created by janrinok (52) for logged-in users only, but now has been archived.
No new comments can be posted.
Google Engineers Lift The Lid On Carbon - A Hopeful Successor To C++
|
Log In/Create an Account
| Top
| 52 comments
| Search Discussion
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
(1)
(1)
(Score: 0) by Anonymous Coward on Friday July 22 2022, @03:39PM (9 children)
There must be a joke linking it to global warming. Ah, yes, and rule 34.
Anyone, please? Especially the rule 34
(Score: 0) by Anonymous Coward on Friday July 22 2022, @03:58PM
Best I can do is:
"We are the carbon they want to reduce"...
(Score: 2) by Opportunist on Friday July 22 2022, @04:23PM (4 children)
Carbon capture, carbon neutral, low carb... the memes are endless.
(Score: 2) by DannyB on Friday July 22 2022, @07:03PM
Not Carbon capture. It's carbon catch and release.
How often should I have my memory checked? I used to know but...
(Score: 3, Insightful) by driverless on Saturday July 23 2022, @06:42AM (2 children)
Carbon copy. This is merely the Google children doing what a bazillion others have tried and failed at before them, come up with the grand unified replacement for C/C++ that's all things to all people and that everyone will turn to, admire its infinite perfection, and say "I gotta get me some of that".
Or not.
(Score: 2) by bussdriver on Sunday July 24 2022, @04:15PM (1 child)
If it wasn't for the mega corp feeding in support and people copying whatever big successful corp does (and not because it has anything to do with their success) this would die in it's crib.
We need to cap the size of these corporations; they have way too much power and undue influence. Merit doesn't matter.
I find their name "Carbon" and tying to link it with the climate crisis insulting and exploitative; of all languages to try to replace, they choose the most optimized 2 languages in history to replace?
(Score: 2) by driverless on Monday July 25 2022, @05:17AM
Yeah, that's the problem, they can just pour endless resources into whatever brain fart one of their children had this morning, and others will follow it just because Google is doing it. Then when their corporate ADHD kicks in and they switch to something else, everyone else who's signed up for it is left in the lurch.
Yet another reason for sticking with C/C++, I know that no matter how many fads the Google children run through in the future, I'll always be able to make a living with that combination.
(Score: 5, Funny) by maxwell demon on Friday July 22 2022, @04:36PM (2 children)
The process of getting rid of the language after you find out that using it for your project wasn't a good idea after all is called decarbonization.
The Tao of math: The numbers you can count are not the real numbers.
(Score: 2) by JoeMerchant on Friday July 22 2022, @05:00PM (1 child)
I would imagine they're going for "elemental" but they certainly remind me of the undesirable sooty residue left after a fire that didn't burn hot enough.
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
(Score: 0) by Anonymous Coward on Saturday July 23 2022, @09:02AM
I reckon they're looking for some kind of viral marketing action comparable to Java == Coffee horseshit.
(Score: 5, Insightful) by Booga1 on Friday July 22 2022, @03:59PM (6 children)
Carbon? Really, like the one from Apple? [wikipedia.org]
I get it, naming things is hard, but it would be great if they could use something that hasn't already been associated with another unrelated computer technology. Acronyms are hard enough to keep track of, but it's like they aren't even trying.
(Score: 3, Informative) by JoeMerchant on Friday July 22 2022, @04:57PM (1 child)
That was my first thought... I had to make a decision about the dev environment to launch a project in in 2006: Carbon or Cocoa (I forget, was Cocoa the older one?) Anyway, I chose Qt, which certainly saved a lot of rewrite when we were forced to move the project to Windows as an OS 8 months later.
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
(Score: 1, Interesting) by Anonymous Coward on Friday July 22 2022, @08:08PM
Carbon and Cocoa were both released as part of the same initial version of OS X. They both called the same low-level API but with different semantics. Carbon was closer to the OS 8 and 9 API but Cocoa was closer to the native calls on OS X and iOS. Qt and other application frameworks called whichever API is appropriate for the platform.
(Score: 5, Insightful) by Anonymous Coward on Friday July 22 2022, @11:09PM
It is also ironic that the people at Google don't seem to know the importance of picking a googleable name.
(Score: 2, Funny) by Anonymous Coward on Saturday July 23 2022, @09:14AM
Covfefe...?
(Score: 3, Funny) by acid andy on Saturday July 23 2022, @12:24PM (1 child)
I know, I know... I'm still smarting from the Common Gateway Interface / Computer Generated Imagery collision--so insensitive! I mean, nowadays they're all worried about a disk drive being called the master but don't give CGI a second thought!
Master of the science of the art of the science of art.
(Score: 2) by hendrikboom on Saturday July 23 2022, @03:32PM
And then there's the confusion between Computer-Generated Imagery and Computer-Generated Image!
(Score: 5, Funny) by Rosco P. Coltrane on Friday July 22 2022, @04:03PM (3 children)
An overflowing cat litterbox is a worthy alternative to C++.
(Score: 4, Funny) by DannyB on Friday July 22 2022, @07:04PM
A good language would prevent overflows.
How often should I have my memory checked? I used to know but...
(Score: 4, Funny) by DannyB on Friday July 22 2022, @07:05PM (1 child)
What do you think Garbage Collection is for?
How often should I have my memory checked? I used to know but...
(Score: 0, Flamebait) by Anonymous Coward on Saturday July 23 2022, @09:09AM
Taking your mom home.
(Score: 3, Interesting) by JoeMerchant on Friday July 22 2022, @05:06PM (8 children)
This bit sounds to me like they're just frustrated with all the committee process in C++ language governance and want to show what's on their minds without going through the process:
Paraphrasing: "Go, Swift, Kotlin, Rust, and many more... the designs of these languages present significant barriers to adoption and migration from C++." And maybe if they're successful then Carbon could be a good C++ wrapper the way C++ is a good C wrapper... Just don't screw up my toolchains, there's nothing I hate more than having to spend days fiddling with toolchains before I can get any work done on the project itself.
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
(Score: 3, Informative) by RamiK on Friday July 22 2022, @05:33PM
They've referenced https://cor3ntin.github.io/posts/abi/ [github.io] so they're pretty explicit about it.
compiling...
(Score: 4, Funny) by DannyB on Friday July 22 2022, @06:10PM (5 children)
The site mentioned robust governance. But I see nothing about a CoC (code of conduct).
(ducks, hides under desk)
How often should I have my memory checked? I used to know but...
(Score: 3, Insightful) by DeVilla on Friday July 22 2022, @08:39PM (4 children)
I wanted to laugh at this, but I saw the git project a few days ago. You can't finish the README without seeing a reference to the CoC.
(Score: 1, Funny) by Anonymous Coward on Saturday July 23 2022, @09:12AM (3 children)
Would it hurt you to think of the children for once?
(Score: 3, Funny) by DannyB on Saturday July 23 2022, @08:49PM (2 children)
Isn't it part of the Code of Conduct that you NOT think of the children?
How often should I have my memory checked? I used to know but...
(Score: 2) by looorg on Saturday July 23 2022, @11:00PM (1 child)
Thinking is fine. You can even peek. You can't just ever poke them.
(Score: 0) by Anonymous Coward on Sunday July 24 2022, @06:32AM
A good number of peekers-not-pokers with criminal conviction for possessing kiddie-porn would be glad to be as you say.
(Score: 2) by Joe Desertrat on Saturday July 23 2022, @02:10AM
I would guess the one thing you can count on is that they will screw up your toolchains.
(Score: 5, Interesting) by RamiK on Friday July 22 2022, @05:24PM (9 children)
That's a nice way of saying you need to learn c++ through-and-through to write carbon since it's written side-by-side next to c++ in the same way c++ was grafted onto c.
My knee jerk prediction is that it's going to be ignored by c++ devs since the learning curve is already too demanding for them to learn anything new. Maybe c devs would end up using it though... We'll see I guess.
compiling...
(Score: 2) by JoeMerchant on Friday July 22 2022, @07:08PM (8 children)
Oh, pish posh. I'm sure there are plenty of Kotlin programmers out there who are completely unable to program in proper Java.
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
(Score: 0) by Anonymous Coward on Friday July 22 2022, @08:15PM (1 child)
Define "proper Java" under 300 pages.
(Score: 2, Insightful) by Pyro_MX on Saturday July 23 2022, @12:17PM
> Define "proper Java" under 300 pages.
This applies to pretty much all languages, but here goes.
Write your program to do what it's supposed to do - not check every box in the Enterprise Integration Patterns book.
(Score: 2) by looorg on Friday July 22 2022, @08:15PM
The only proper Java is the one I drink as I write code.
(Score: 2) by RamiK on Friday July 22 2022, @08:43PM (4 children)
Java is a fairly readable language. Moreover, the development workflow for Java and Kotlin goes through a debugger* anyhow so you circumvent a lot of problems you'd otherwise run into trying to work with a foreign language.
* for the uninitiated, when Java is taught as a first language in a pure CS curriculum, the first program you write isn't an hello world. In fact, you're not taught a print() statement at all. You're taught to load a variable as an int, put a watch on it and then step through. The next program (or dozen) have you playing around with classes, inheriting stuff and overloading other stuff... In some CS schools you can go through a full semester or two without learning any input/output since they solely focus on data structures and algorithms and don't care about actually doing anything of use with the language. In one case I've seen they just abandoned Java in the 2nd year before learning to do anything with it and switched to C/C++ for the systems courses... Mind you, this was a fairly successful program.
compiling...
(Score: 5, Interesting) by linuxrocks123 on Saturday July 23 2022, @03:26AM (1 child)
I took a first programming class taught in Java once, many years ago. The first program was Hello World. I don't remember when we did classes, but it wasn't right away. Many years later, and fairly recently, I taught the first programming class for CS majors at a university multiple times over the course of four years. The language was Java, and the first program was Hello World. Looking through my old lecture slides, it looks like we didn't do anything with classes until near the end of the first semester.
I'm guessing there probably is a school of thought out there that does it the way you state, although I haven't personally heard of it, but that's not how everyone does it.
I do think the thing about stepping through code in a debugger is a good teaching tool. That's why I created Pasithea for teaching intro CS. It forces you not to make compilation errors because it won't let you move off of a line if the program wouldn't compile. The only escape hatch is that you can click off the line instead of using the arrow keys. Also, the lower right window pane has the values of all variables as they would be if the program were stopped at the current line the cursor is on, so that gives the advantages of stepping through a debugger. It's worth checking out if you're teaching intro CS using Java, I think:
http://moongate.ydns.eu/philotes/ [moongate.ydns.eu]
Note that the "won't let you move off of a line" thing means you have to write a skeleton of a program all on one line to start out. Also note that this isn't backed by a real Java compiler but an interpreter I wrote for the subset of the language needed for the intro CS class. On the same website, there's also an REPL interpreter called Philotes and a command-line program called Hypnos that runs an existing file directly.
I've mostly abandoned this project since I stopped teaching, but I have minimally been maintaining it. If anyone is interested, there's code on GitHub here:
https://github.com/linuxrocks123/pasithea [github.com]
The code on GitHub isn't the latest version, but, if anyone tries to talk to me there, I'll update it from my private repo. Also, if there are current CS teachers on SoylentNews who want to use this, I'm opening to doing what's necessary to keep it working and even improve it, ideally with help.
I should have posted about Pasithea earlier on here; it's pretty cool. Thanks for bringing up intro Java, RamiK.
(Score: 2) by RamiK on Saturday July 23 2022, @09:43AM
I'm talking about the "introduction to computer science" type courses that try to teach you math first, cs 2nd, programming 3rd, java 4th. In engineering and intro to java classes it would be naturally taught the conventional way like you were taught. Though to be clear, it's not that the courses don't teach System.out.println("hello world"); in the first few classes. It's just that it's just a single slide example before moving into debugger use and staying in the debugger for the rest of the year, assignments and tests included.
While I also like the interactive approach (debuggers and repl), my personal weakness was and is math, data structures and algorithms rather than the workflow and craft of programming so I personally benefited more from the old school "tests would be conducted using pen & paper and would be graded on both computational correctness and successful execution" where you learn not to depend on the compiler to tell you you forget a brace or a dereference.
Regardless, (old?) Java isn't suitable for pen & paper due to the verbosity so you typically see it being taught with either debuggers or print() all over. You can spot the debugger courses with those apple and fruit object-classes examples where you have literally 100 loc without a single println() call.
Either way, I suspect everyone need a bit of both so it's mostly just a question of what is taught first.
compiling...
(Score: 2) by JoeMerchant on Saturday July 23 2022, @03:12PM (1 child)
>don't care about actually doing anything of use with the language.
Can't help but take a jibe at the Google Play store and most of its content here....
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
(Score: 3, Touché) by RamiK on Saturday July 23 2022, @04:55PM
Well, it does say "Play" in the title so it's really our fault for expecting more... ;)
compiling...
(Score: 2, Interesting) by Anonymous Coward on Friday July 22 2022, @06:13PM
That's all you need to know as to why you should not adopt this. See also Rust and Mozilla Engineers.
(Score: 5, Interesting) by ilsa on Friday July 22 2022, @06:22PM (1 child)
Ever since the debacle with Angular 1.0, I've been leery that any languages Google puts out would have the same extreme ADHD properties as the rest of their mercurial lineup.
So far everything they have done has been evidence that I made the correct choice.
Microsoft did the same thing when they were more dominant, but Google is taking it to a whole other level, constantly dropping new half-assed, poorly designed langauges.
I will not touch anything new thing google makes, on general principal alone. It's just too risky.
(Score: 2) by JoeMerchant on Friday July 22 2022, @07:11PM
I found Kotlin to be rather compelling for certain Android Phone toolchains... have I mentioned that phone development is a nasty treadmill every bit as bad as DOS in the early 1990s?
Україна досі не є частиною Росії Слава Україні🌻 https://news.stanford.edu/2023/02/17/will-russia-ukraine-war-end
(Score: 3, Interesting) by looorg on Friday July 22 2022, @08:21PM (2 children)
I guess it must be $day as there is yet another C++ replacement nobody asked for ...
Considering how many C++ successors or replacements there have been on offer isn't it kind of wishful thinking that this would be the replacement, hopeful or not? Coming up with a "new" C++ replacement is old news. If the performance only matches C++ why would I replace C++ with this? If it doesn't offer things that are better, faster or smaller then why would you invest the time and effort into this. Also the name is stupid (Ha! That is as far as I'm willing to go in investing time and effort into this new language).
(Score: 3, Interesting) by Anonymous Coward on Friday July 22 2022, @10:07PM (1 child)
The motivation for replacing C++ is to have a language that is high performance but unburdened by decades of backwards compatible cruft that has accumulated in C++ over decades, particularly since C++ did not start off with a clean, coherent design, but was the result of creating a thin shim over C. C++ is a drag on the industry as it is the most complex programming language ever invented.
The vast majority of programmers use cleaner, easier languages, but those languages are not as fast as C++. Even the best of those languages run at half the speed of C++ and use gobs more memory.
(Score: 2, Touché) by Anonymous Coward on Saturday July 23 2022, @01:01AM
Let me paraphrase it. The goal is to enable cheap off the shelf Indians to write great software. Fat chance.
(Score: 5, Insightful) by Mykl on Saturday July 23 2022, @05:31AM (1 child)
We seem to get one of these articles about every 6 months - a bunch of people decide it's finally time to replace C++ and go about making something wonderful that nobody wants to use.
The reason that C++ continues to dominate is the same reason that English is the default universal language of business - everyone's already using it. Just like C++, English is a terrible language to learn, full of cruft and old baked-in stuff from early heritage (resulting in grammatical inconsistencies etc). But the effort to go and switch everything over to a new flavour-of-the-month is just too great. If it was easy, we'd all be speaking Esperanto now.
Having said that, business does have a keen interest in Java and .Net - those are also highly unlikely to be toppled by the new Carbon language.
(Score: 3, Insightful) by driverless on Saturday July 23 2022, @07:02AM
Exactly. C/C++ isn't the competition, it's the environment.
(Score: 0) by Anonymous Coward on Saturday July 23 2022, @10:09AM
Will Carbon programs be sentient?
(Score: 2) by bradley13 on Saturday July 23 2022, @11:20AM (1 child)
...but ultimately not very useful.
Sure, every established language has accumulated some historical baggage. So what? Programming is about finding ways to implement algorithms, to represent data, to present complex information in an understandable fashion. As long as a language lets you express these things, it doesn't much matter if it is 30 years old. Personally, I've used something like 20 different languages. As long as you understand the underlying paradigm (functional, OO, etc.), the biggest challenge in learning a new language is getting acquainted with the libraries provided. The rest is just syntax.
New languages are always just rehashes of the existing paradigms: imperative, object-oriented, functional, or (rarely) logical programming. Whether you use semicolons, whether paramaters are by-reference or by-value, etc, etc - so what? Genuinely new concepts are rare, and usually pretty irrelevant. In the specific case of Carbon, the innovative new features are apparently:
- Generics. Rather that using C++ templates, have generics as an integral part of the language.
- Memory safety. Presently vaporware, but they want to achieve this, somehow, maybe, promise...
And...that's it. It has a slightly different syntax, actually very Java-like. Maybe they should just use Java, since it already has generics, and is much more memory safe than C++.
Everyone is somebody else's weirdo.
(Score: 3, Interesting) by theluggage on Saturday July 23 2022, @02:40PM
Well, using generics instead of templates (and not going down the multiple inheritance rabbit hole) is a decision that has been taken by virtually every post-C++ language since Java, so that's hardly innovative - and I'd have thought that even most C++ programmers should have learned the "just because you can doesn't mean you should" lesson by now. The idea behind Carbon seems to be to avoid "the perfect is the enemy of the good" and offer a cleaned-up replacement for C++ that is easier for new programmers and doesn't force back-to-the-drawing board conceptual changes on existing C++ programmers - including making it easy to interoperate with existing C++ code, rather than the "forget everything you thought you knew" approach of (say) Rust or Swift.
That said, for fsck's sake, do we really need yet another variation on the syntax for "define a function that takes these parameters and returns this type"?
C++ is a Scooby Doo sandwich of styles with plain old C and the classic C library at the bottom and geological layers of other concepts piled on top until you get to all the "modern" features (like safer pointers) - which have been bolted on using the template syntax. You could imagine a "translator" language that just dropped backwards compatibility with C and generated all the std::unique_ptr<pkg::Type> etc. boilerplate inherent in "modern" C++. I think that may be what Carbon is getting at.
However, I don't think a new language can really take off on merit without a killer application or library. C had - well, Unix and the fact that PC implementations of C came with the hugely useful standard library. C++ had a head start from C and was popularised on the PC by all the tools for building GUI apps in Visual C/C++ etc. Java was always joined at the hip with a handy cross-platform GUI library (ideal for forms etc). BASIC - try compiling Pascal on a 1980s home computer with no floppies. Heck, PHP is a candidate for worst. language. ever. but it got huge adoption because it included all the tools for dynamically generating HTML. Nobody would look twice at Javascript if it wasn't embedded in every web browser.
(Score: 2) by Hyper on Saturday July 23 2022, @03:34PM
https://xkcd.com/927/ [xkcd.com]
How many standards..err.. languages.. do we have now?