Live data from Hacker News

Google Launches Carbon, an Experimental Replacement for C++

thenewstack.io

131–140 of 243 posts

Re: Google Launches Carbon, an Experimental Replacement for C++

#131
post #45

Earlier quoted context omitted.

> Rust isn't any more complex, but it's not radically simpler either. Safe Rust doesn't have classes, inheritance, copy constructors, move constructors, header files, preprocessor, textual substitution macros, code executing before main(), exceptions, global variables, pointer arithmetic... Looks radically simpler to me.

In general, I think it's easy to conflate simplicity with ease. Ease is always a matter of context and what one is familiar with. I agree that Rust is simpler than C++ and I think a lot of people mean that Rust isn't easier (up front). Given how new and different it can be, that makes sense.

Obligatory Rich Hickey plug: https://m.youtube.com/watch?v=SxdOUGdseq4

Re: Google Launches Carbon, an Experimental Replacement for C++

#132
post #82

Ugh, It may be superior in every way (I haven't had time to read up on how or why yet) but the name? Has no one at Google ever developed in the Apple ecosystem? I know it's been 10 years but still.. It's not as bad as Microsoft though, with the word "Unity" - both a game development platform and an IOC container. Had loads of fun googling help for the IOC container when 90% of the results were about the game dev plat…

Microsoft doesn't own the Unity engine, even though it uses the MS tech stack heavily. The IOC stuff though you aren't wrong on.

Re: Google Launches Carbon, an Experimental Replacement for C++

#133

While I have not had time to check this out, more generally whenever I read “Google launches…” I wonder how long until it makes it into the ever-growing graveyard? [1] https://killedbygoogle.com/ [2] https://gcemetery.co/

This is an experimental project, being very clearly pitched as such, and with the documentation being really clear about how if you can use any other language you should. They're bending over backwards to make the expectations clear. It is being developed in the open, targets a goverance model of an open foundation not controlled by any company, and has a goal that no more than half the contributors to the language should be from any one company. It's also a programming language whose compiler you'd run on your local machine, not a networked service that can actually be shut down.

Out of all the projects where you could trot out this tired "killed by google" shit, this is literally the worst one. What is your thought process here? "I don't know anything about the subject, but let me repeat a lame joke that people will surely find hilarious despite it being the thousandth time it gets posted to HN this year. Surely it will play to the crowd."

Re: Google Launches Carbon, an Experimental Replacement for C++

#134

"The keepers of C++ prioritize backward compatibility, in order to continue to support widely-used projects such as Linux" I thought Linux was C only and Linus is actively hostile against cpp for some good reasons.

I expect they're talking about the Linux userland C++ ABIs.

Re: Google Launches Carbon, an Experimental Replacement for C++

#135
post #5

var r : i32; How is this any better than int32_t r; ? all I see is additional, unnecessary keyword to type.

I can't see details of the Carbon syntax for pointer, array and function types, but this is where Rust's type syntax really excels compared to the C++ style. let foo : & fn(&[MyType], i32) -> String = ... (a reference to a function that takes a slice and a 32bit signed integer as arguments and returns a string) is dramatically simpler than the C/C++ equivalent. More subjectively, I find `var` or equivalent makes code…

It's definitely as hard to read as C++ though.

Re: Google Launches Carbon, an Experimental Replacement for C++

#137
post #23

I'm probably just biased, but to me the problem with modern C++ is its complexity. The mental model of the language, its syntax, and the amount of history / number of interfaces a programmer needs to be familiar with to be productive are all too large. Rust isn't any more complex, but it's not radically simpler either. Carbon doesn't look like it solves this problem. It would seem that creating a language that is exp…

to me that's the greatest benefit of C++ and hence why it's so successful. it's kitchen sink language. choose what features you want. choose your own style. you wanna do OOP | DOP suit yourself. that versatility is why C++ is unmatched in terms of where it's deployed.

Isn't the 'kitchen sink' approach what ended up causing Perl to fade from relevance? I am only casually aware of this, and I may be totally misremembering things, but Perl used to be seen as a swiss army chainsaw but people eventually came to realize that maintenance was a nightmare.

Re: Google Launches Carbon, an Experimental Replacement for C++

#138
post #65
post #28

Earlier quoted context omitted.

This comment and parent comment don't appear to have read the article. It's specifically targetting C++ compatibility, that means compatible threading model, memory model, ABI, type system, ... Rust has none of these. For every line of Rust code in the world, there are likely 10e3 - 100e3 lines of C++. You can either label it all "legacy code" and pretend your employer has the budget or time to rewrite it all, or you…

Google rewrites a lot of their software components from scratch every few years, at least according to section 2.11 of this paper: https://arxiv.org/pdf/1702.01715.pdf

I only run one team, but this is not my experience at Google whatsoever. Some stuff gets rewritten but this is not planned and is largely due to catastrophic changes in requirements or very bad initial designs.

Re: Google Launches Carbon, an Experimental Replacement for C++

#139

"The keepers of C++ prioritize backward compatibility, in order to continue to support widely-used projects such as Linux" I thought Linux was C only and Linus is actively hostile against cpp for some good reasons.

> I thought Linux was C only It won't be for long (Rust) https://thenewstack.io/rust-in-the-linux-kernel-by-2023-linu... . But I don't expect C++ to be added.

> > I thought Linux was C only

> It won't be for long (Rust)

To be pedantic, it already isn't; a small but very important part of Linux is written in assembly (it used to be more, but most of it was ported to C; what's left is a small core which simply cannot be expressed correctly in C).

Re: Google Launches Carbon, an Experimental Replacement for C++

#140

How to make your replacement for a C language Google-able: name it after an API for a C language: Carbon was one of two primary C-based application programming interfaces (APIs) developed by Apple for the macOS (formerly Mac OS X and OS X) operating system. Compare also keywords or key terms: Carbon will be built on a foundation on modern programming principles, including a generics system, that would remove the need…

…or we're just running out of names that are puns of "C" for C++ successor languages, so things that were deprecated a decade ago are now fair game?

Are you kidding? There's tons of other words that start with C. And why would it need to anyway?

This trend of not putting any thought into what you name your language/framework/application is fairly new and shows serious laziness. Google's team should have done better. Naming things is hard but if you're going to make something worth people's time, it's worth spending a little more effort than they did.

Post reply on HN