Live data from Hacker News

Google Launches Carbon, an Experimental Replacement for C++

thenewstack.io

91–100 of 243 posts

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

#91
post #70

Earlier quoted context omitted.

Nim also uses 'var' and 'let' for mutability. I like it as well.

knowing neither of these languages i’d rather it be labeled something more clear as neither one of those screams immutable to me. the immutable variant should use the ‘const’ keyword instead.

Const variables are traditionally initialized at compiled time. In Swift, let may be initialized at runtime and then becomes immutable.

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

#92

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…

You can choose to be simple, expressive, performant and small with C++: https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b

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

#93

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…

It's not inheriting the complexity though. That's sort of the whole goal - the next 'generation' of C++ that can be used interchangeably with actual C++ but allowing re-visiting most of the design decisions and throwing out old features.

The Github Page[1] says this: "The best way to address these problems is to avoid inheriting the legacy of C or C++ directly, and instead start with solid language foundations like modern generics system, modular code organization, and consistent, simple syntax."

[1] https://github.com/carbon-language/carbon-lang

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

#94
post #83

Seven years ago someone at Google estimated that there was 2 Billion lines of code in production to support Google Services [1]. Given this was seven years ago the number is probably much higher now and a large chunk of it is C++. Clearly any replacement language for C++ has to seamlessly (as primary design goal at least) consume and update this gigantic C++ code base. Nobody is rewriting all of that from scratch. Th…

Exactly, Rust has been around for a while and it hasn't reached parity in terms of LoC with C and C++ in Gecko's codebase, presumably because it's impossible to rewrite individual units unless the API is impossibly narrow. This new language will be more like different JVM langs in terms of interop.

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

#95

I'm jumping into this a few hours late, but nobody has actually straight up asked the real question: Why try to compete with Rust while not really being a better Rust? The linked article generally defines a language that is more of the same, while Google is throwing Go under the bus to make it happen. The number of current and former Google employees that transitioned from being Gophers to being Rustaceans that I kno…

Rust has complicated interop with C++ and it is incredibly difficult to automate useful transcompilation from C++ to Rust. Various dynamic safety tools also don't work when you've got both Rust and C++ working together. The idea with Carbon appears to be a language with a much easier ramp for existing massive C++ codebases.

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

#97

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…

Carbon API is so old that this pretty much isn't issue. You have to google explicitely for "Carbon API" for it to show up. Whether even now, "carbon programming" or "carbon code" give results for Carbon language - and some other non-c++ libs named Carbon. Even "carbon" by itself gives me some Carbon language links.

I suppose you’re using google as a search engine?

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

#98
post #83

Seven years ago someone at Google estimated that there was 2 Billion lines of code in production to support Google Services [1]. Given this was seven years ago the number is probably much higher now and a large chunk of it is C++. Clearly any replacement language for C++ has to seamlessly (as primary design goal at least) consume and update this gigantic C++ code base. Nobody is rewriting all of that from scratch. Th…

You don't need to rewrite existing code. Just develop new code in it.

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

#99

I'm jumping into this a few hours late, but nobody has actually straight up asked the real question: Why try to compete with Rust while not really being a better Rust? The linked article generally defines a language that is more of the same, while Google is throwing Go under the bus to make it happen. The number of current and former Google employees that transitioned from being Gophers to being Rustaceans that I kno…

My read on Carbon is that Google is in a spot where they have enormous amounts of C++ code flying around in a very idiosyncratic C++ dialect, and standard C++ is not working that well for them. So they are looking to create a C++-compatible language that better serves the needs of their codebase. We've seen this before with Facebook and PHP.
Post reply on HN