1
4 Comments

Google Carbon Lang vs Rust - Which one is better?

When Google announced Carbon programming language, immediate question that popped up is

👩‍💻How Carbon language is different from Rust❓

Working with C++, Rust, Carbon.

Which language do you prefer ?

submitted this link to Icon for group Developers
Developers
on August 14, 2022
  1. 1

    Another month, another Google programming language. Oh joy.

    I believe that Google is in a difficult situation because they have a lot of C++ code that is not compatible with the standard C++ dialect - its a very google idiosyncratic C++ dialect. They need a language that is compatible with C++ but better suits their needs.

    If you are wondering what makes carbon different from Rust or Zig, it is the ability to interoperate with a wide variety of code, including classes/structs and templates, not just free functions. Carbon is also willing to expose the idioms of C++ into Carbon code, and the other way around, when necessary to maximize performance of the interoperability layer. The use of wrappers and generic programming, including templates, also helps to minimize or eliminate runtime overhead.

    More than 7 years ago [1], someone at Google estimated that there were 2 billion lines of code in production to support Google Services. Clearly, any replacement language for C++ has to be able to seamlessly consume and update this gigantic C++ code base. That pretty much rules out Rust, Golang, and various other languages which only provide thin "extern C function" level compatibility at best. It would be interesting to see how the language progresses.

    [1] https://www.wired.com/2015/09/google-2-billion-lines-codeand-one-place/

  2. 1

    So, Carbon hasn't actually officially been released yet. But the idea behind is that it's intended to "replace" C++. Unlike Rust, it's completely interoperable with C++ meaning you can call Carbon functions from C++ and vice versa.

    Rust is intended to be an entirely standalone, low level, high performance, memory safe language.

    I haven't used Carbon (and doubt most people on IH have) - again it's not officially released yet. But I like Rust a lot. It challenges the way that you write code. It's a very steep learning curve, especially coming from a dynamically typed language, but code written in Rust is virtually guaranteed to be performant and safe.

    1. 1

      Totally true. Rust is definitely lot matured and Carbon is still in barebones. I just tried Carbon for fun (https://tipseason.com/carbon-language-tutorial-syntax/) and looks like lot of concepts were inherited by looking at most modern languages including Rust. Anyways let's wait and see how this evolves. Thanks for your detailed response.

  3. 0

    Hey, pretty nice question. So, my opinion on this question would be that every language has its own set of pros and cons. So, its better if you hire a talented full stack developer, hire backend developer or hire frontend developer as they can be a great help to you in your project.

Trending on Indie Hackers
Your build-in-public audience is not your market. I learned the difference the slow way. User Avatar 226 comments I built a WhatsApp AI bot for doctors in Peru — launched 3 weeks ago, 0 paying customers, and stuck waiting for Meta to approve my app User Avatar 62 comments Built a "stocks as football cards" thing. 5 days in, my launch tweet got 7 views. What am I missing? User Avatar 33 comments Why Claude Skills Are Becoming Important for Tech Careers User Avatar 25 comments How to automatically turn customer feedback into high-converting testimonials User Avatar 23 comments I kept starting projects and dropping them. So I built a system that wouldn’t let me User Avatar 23 comments