Live data from Hacker News

Carbon Language: An experimental successor to C++

docs.carbon-lang.dev

51–60 of 200 posts

Re: Carbon Language: An experimental successor to C++

#51
Related. Others?

Carbon is not a programming language (sort of) - https://news.ycombinator.com/item?id=42983733 - Feb 2025 (97 comments)

Ask HN: How is the Carbon language going? - https://news.ycombinator.com/item?id=40480446 - May 2024 (1 comment)

Will Carbon Replace C++? - https://news.ycombinator.com/item?id=34957215 - Feb 2023 (321 comments)

Carbon Programming Language from Google - https://news.ycombinator.com/item?id=32250267 - July 2022 (1 comment)

Google Launches Carbon, an Experimental Replacement for C++ - https://news.ycombinator.com/item?id=32223270 - July 2022 (232 comments)

Carbon Language: An experimental successor to C++ - https://news.ycombinator.com/item?id=32151609 - July 2022 (504 comments)

Carbon: high level programming language that compiles to plain C - https://news.ycombinator.com/item?id=4676789 - Oct 2012 (39 comments)

Re: Carbon Language: An experimental successor to C++

#52
post #50

I think this page describes "what" but not "why" of Carbon. Carbon exists so that it's possible to migrate a large C++ code base, like Chrome, from C++ to something saner, incrementally. The most important attribute of Carbon is not the specifics of the syntax but the fact that it's designed to be used in a mixed C++ / Carbon code base and comes with tooling to convert as much of C++ as possible to Carbon. That's wha…

Not to disagree, but to amplify - FWIW, most of what you say was also the sales pitch for C++ over ANSI C in the early 90s vs. the "pure Java" mentality that shortly followed in the late 90s (with a megaton of Sun Microsystems marketing to re-write almost everything rather than bridge with JNI). People neglect how practical incrementalism can be.

Also, FWIW, it is very ergonomic for Nim to call C (though the reverse is made complex by GC'd types). { I believe similar can be said for other PLangs you mention, but I am not as sure. } It's barely an inconvenience. Parts of Nim's stdlib still use libc and many PLangs do that for at least system calls. You can also just convert C to Nim with the c2nim program, though usually that requires a lot of hand editing afterwards.

Maybe they should write a C++2carbon translator tool? That would speed things up for them. Maybe they already have and I just haven't heard of it? I mean the article does say "some level of source-to-source translation", but I couldn't find details/caveats poking around for a few minutes.

Re: Carbon Language: An experimental successor to C++

#53
I remember back when carbon first appeared, I immediately thought it's not gonna get popular simply because it has "fn" and "var"

superficial details matter - people that stayed on C++ instead of transitioning to flashy new ones have type-before-name as part of programming identity

you can have all the features in the world (and be recognized by it), but if the code doesn't _look_ like C++, then it's of no interest

Re: Carbon Language: An experimental successor to C++

#54
post #46

Earlier quoted context omitted.

In C++ you can use indifferently either the class or typename keyword to introduce template arguments (because of course you can). A lot of styleguides suggest using typename because class is slightly misleading (the type could be anything not just a class). In practice everybody just uses class, because who as the time to type the full keyword and signature declarations in C++ are already unwieldy as it is.

Anyone using a proper IDE instead of notepad like editor.

I do use a proper ide with with clangd completion and all kind of helper macros, but I can still type 'class' faster than I can trigger completion.

Re: Carbon Language: An experimental successor to C++

#56
post #52
post #50

I think this page describes "what" but not "why" of Carbon. Carbon exists so that it's possible to migrate a large C++ code base, like Chrome, from C++ to something saner, incrementally. The most important attribute of Carbon is not the specifics of the syntax but the fact that it's designed to be used in a mixed C++ / Carbon code base and comes with tooling to convert as much of C++ as possible to Carbon. That's wha…

Not to disagree, but to amplify - FWIW, most of what you say was also the sales pitch for C++ over ANSI C in the early 90s vs. the "pure Java" mentality that shortly followed in the late 90s (with a megaton of Sun Microsystems marketing to re-write almost everything rather than bridge with JNI). People neglect how practical incrementalism can be. Also, FWIW, it is very ergonomic for Nim to call C (though the reverse…

fwiw, many PLs find themselves needing to have C FFI if they want to support MacOS. It's not just a convenience thing.

Re: Carbon Language: An experimental successor to C++

#57
post #44
post #24

Earlier quoted context omitted.

How about "proc"? Too different? I don't like fn either but function is too much. Fun and func aren't great either. I'd go with proc or fn.

fun, press tab, modern IDE fills in the remaing function characters. Unfortunately we keep designing languages for people using notepad. Nowadays my editor even writes full blocks at a time.

If "fun" and "func" are already "not great" (because, I presume, they're too long), then "fun[TAB]" is not the solution.

Mind you, I'm not saying that your solution doesn't work. Just that it doesn't work for the GP.

Re: Carbon Language: An experimental successor to C++

#58
post #50

I think this page describes "what" but not "why" of Carbon. Carbon exists so that it's possible to migrate a large C++ code base, like Chrome, from C++ to something saner, incrementally. The most important attribute of Carbon is not the specifics of the syntax but the fact that it's designed to be used in a mixed C++ / Carbon code base and comes with tooling to convert as much of C++ as possible to Carbon. That's wha…

A similar example is Facebook/Meta inventing Hack to progressively replacing the old PHP code.

Re: Carbon Language: An experimental successor to C++

#59
post #50

I think this page describes "what" but not "why" of Carbon. Carbon exists so that it's possible to migrate a large C++ code base, like Chrome, from C++ to something saner, incrementally. The most important attribute of Carbon is not the specifics of the syntax but the fact that it's designed to be used in a mixed C++ / Carbon code base and comes with tooling to convert as much of C++ as possible to Carbon. That's wha…

Zig is designed to interoperate like this with C, and Kotlin with Java.
Post reply on HN