Any interest in the new Carbon language that can interoperate with c++ ?

Seems to be heavily used by google as an in house language that they’ve now decided to open up to the world.

The git info is all here…

As a mainly c# developer at work it seems easier to create code which is a fair bit more readable than c++ and being able to create type safe generics is something I lean on heavily normally. Carbon is bidirectionally inter-operative, at least according to the blurb, which suggests you can just use a translation layer to use bits of Carbon code where you like e.g. to simplify just a few classes or functions in a bigger, largely c++, project.

This bit in their readme caught my eye…

—-

Memory safety

Safety, and especially memory safety, remain key challenges for C++ and something a successor language needs to address. Our initial priority and focus is on immediately addressing important, low-hanging fruit in the safety space:

  • Tracking uninitialized states better, increased enforcement of initialization, and systematically providing hardening against initialization bugs when desired.
  • Designing fundamental APIs and idioms to support dynamic bounds checks in debug and hardened builds.
  • Having a default debug build mode that is both cheaper and more comprehensive than existing C++ build modes even when combined with Address Sanitizer.

Once we can migrate code into Carbon, we will have a simplified language with room in the design space to add any necessary annotations or features, and infrastructure like generics to support safer design patterns. Longer term, we will build on this to introduce a safe Carbon subset. This will be a large and complex undertaking, and won’t be in the 0.1 design. Meanwhile, we are closely watching and learning from efforts to add memory safe semantics onto C++ such as Rust-inspired lifetime annotations.

—-

Sucks that the install docs are all based around ‘brew’ which is primarily for MacOS/Linux, but I have read it’s feasible to use it on Windows via the Linux subsystem.

Seems to have goals overlapping to some extent with the Zig language, which I find very interesting.

1 Like