Carbon memory safety deep dive

Worth taking a look for all memory-safety curious:

Video: https://drive.google.com/file/d/1tQlzpnbWZfn2WtTFMoJgF93QteByBBwm/view

Slides: Carbon memory safety: a first deep dive (v3) (you can reveal speaker notes by pressing s key)

10 Likes

This is nice (strong mine)!

  • Carbon defaults to “value” calling convention
    • Different behavior for different types
    • Copies types where that is cheap
    • Or an immutable borrow + const reference
      • An error if a copy is needed
      • Means expensive copies will be explicit in source
5 Likes

Perhaps this is just a meaningless rant, but the syntax of Carbon and C++ looks like a complete mess.

What I mean isn’t about lax syntax design or anything like that—rather, it’s the piles of symbols everywhere related to generics and lifetimes. At first glance, the parts that actually express “business logic” are almost drowned out by various constraints, forwarding, exception guarantees, and type computations.

Perhaps people should invent a way to separate the parts that express business logic from type gymnastics.

1 Like

Isn’t that the original Zig plan, which has been dropped?