Skip to content

Commit b636065

Browse files
chandlerczygoloid
andauthored
Safety milestones and a 2025 roadmap (#4880)
We propose updating our milestones to accelerate design and implementation of memory safety in Carbon, and a roadmap for 2025 reflecting this change. We also provide a retrospective for 2024's progress. --------- Co-authored-by: Richard Smith <[email protected]>
1 parent 3f599c2 commit b636065

File tree

4 files changed

+231
-92
lines changed

4 files changed

+231
-92
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ and the language:
153153
Carbon (and eventually C++ code as well) into standard executable code. This
154154
is where most of our current implementation efforts are directed.
155155

156-
If you're interested in contributing, we're currently focused on
157-
[developing the Carbon toolchain until it can support Carbon ↔ C++ interop](/docs/project/roadmap.md#objective-for-2024-a-working-toolchain-that-supports-c-interop).
156+
If you're interested in contributing, we're currently focused on developing the
157+
Carbon toolchain until it can
158+
[support Carbon ↔ C++ interop](/docs/project/roadmap.md#access-most-non-template-c-apis-in-carbon).
158159
Beyond that, we plan to continue developing the design and toolchain until we
159160
can ship the
160161
[0.1 language](/docs/project/milestones.md#milestone-01-a-minimum-viable-product-mvp-for-evaluation)

docs/project/milestones.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ around what we expect evaluations to be able to include:
8383
the critical path and get representative performance results.
8484
- This can in turn be a still smaller subset of all aspects of C++
8585
interoperability based around what impacts interesting benchmarks.
86+
- Both strategy and design for memory safety allow evaluators to be confident
87+
in safe Carbon having strong memory safety protections, and being
88+
incrementally adoptable starting from existing C++ codebases.
8689

8790
### Language features
8891

@@ -226,6 +229,17 @@ to be completed as part of 0.1 beyond _language_ features:
226229
those platforms.
227230
- Build system integration for CMake, and documentation for integrating with
228231
Make or similar build systems.
232+
- Detailed safety strategy for Carbon
233+
- Will include specific expectations for how unsafe C++ code and unsafe
234+
Carbon code will interact with safe Carbon code.
235+
- Also includes any tradeoffs or prioritization across different kinds or
236+
levels of safety.
237+
- Detailed and concrete design for safe Carbon
238+
- Must at least include ways in which most modern C++ is safe: type and
239+
initialization safety.
240+
- Must also include spatial, temporal, and mutation safety.
241+
- Will include an analysis of how this impacts _safe_ Rust interop.
242+
- Does _not_ include having a complete implementation in 0.1.
229243
- Basic documentation for evaluators from getting started to FAQs.
230244

231245
## Milestone 0.2: feature complete product for evaluation

docs/project/roadmap.md

Lines changed: 73 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -10,130 +10,113 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
1010

1111
## Table of contents
1212

13-
- [Objective for 2024: a working toolchain that supports C++ interop](#objective-for-2024-a-working-toolchain-that-supports-c-interop)
14-
- [Key results in 2024](#key-results-in-2024)
15-
- [Carbon's toolchain implements enough of the language to build realistic code](#carbons-toolchain-implements-enough-of-the-language-to-build-realistic-code)
16-
- [Carbon's toolchain can build C++ code](#carbons-toolchain-can-build-c-code)
17-
- [Carbon's toolchain works with existing, simple C++ build systems](#carbons-toolchain-works-with-existing-simple-c-build-systems)
18-
- [Carbon has a design and toolchain implementation of basic C++ interop](#carbon-has-a-design-and-toolchain-implementation-of-basic-c-interop)
19-
- [Give talks at 2-3 conferences covering 3-4 different Carbon topics](#give-talks-at-2-3-conferences-covering-3-4-different-carbon-topics)
20-
- [Start building our initial tutorial and introductory material](#start-building-our-initial-tutorial-and-introductory-material)
21-
- [Beyond 2024](#beyond-2024)
22-
- [Potential 2025 goals: ship a working 0.1 language for evaluation](#potential-2025-goals-ship-a-working-01-language-for-evaluation)
23-
- [Potential 2026-2027 goals: finish 0.2 language, stop experimenting](#potential-2026-2027-goals-finish-02-language-stop-experimenting)
24-
- [Potential goals _beyond_ 2027: ship 1.0 language & organization](#potential-goals-beyond-2027-ship-10-language--organization)
13+
- [Objectives for 2025: demo of C++ interop and design of memory safety](#objectives-for-2025-demo-of-c-interop-and-design-of-memory-safety)
14+
- [Key results in 2025](#key-results-in-2025)
15+
- [Access most non-template C++ APIs in Carbon](#access-most-non-template-c-apis-in-carbon)
16+
- [Access non-generic Carbon APIs in C++](#access-non-generic-carbon-apis-in-c)
17+
- [Detailed safety strategy update, including expected tradeoffs and prioritization](#detailed-safety-strategy-update-including-expected-tradeoffs-and-prioritization)
18+
- [Design for compile-time temporal and mutation memory safety](#design-for-compile-time-temporal-and-mutation-memory-safety)
19+
- [Give talks at 2-3 conferences about Carbon topics, expanding our audience](#give-talks-at-2-3-conferences-about-carbon-topics-expanding-our-audience)
20+
- [Beyond 2025](#beyond-2025)
21+
- [Potential 2026 goals: ship a working 0.1 language for evaluation](#potential-2026-goals-ship-a-working-01-language-for-evaluation)
22+
- [Potential 2027-2028 goals: finish 0.2 language, stop experimenting](#potential-2027-2028-goals-finish-02-language-stop-experimenting)
23+
- [Potential goals _beyond_ 2028: ship 1.0 language & organization](#potential-goals-beyond-2028-ship-10-language--organization)
2524

2625
<!-- tocstop -->
2726

28-
## Objective for 2024: a working toolchain that supports C++ interop
27+
## Objectives for 2025: demo of C++ interop and design of memory safety
2928

30-
Our focus for 2024 will be to get the Carbon toolchain working, including C++
31-
interop. We see three key criteria:
29+
We have two areas of focus for 2025:
3230

33-
- Building realistic Carbon code for interesting interop with C++.
34-
- Building realistic C++ code for interesting interop with Carbon.
35-
- The interop itself to allow a single program mixing the two languages.
31+
1. Get a major chunk of our C++ interop working to the point where we can
32+
demonstrate it in realistic scenarios.
33+
2. Build a concrete and specific design for memory safety in Carbon.
3634

37-
This will both allow folks to explore Carbon using a more traditional and
38-
realistic compiler model, and allow that exploratory Carbon to lean on C++ for
39-
libraries and other functionality that doesn't exist in Carbon yet. It will also
40-
demonstrate how the interop will work in practice.
35+
We will scope the first one to non-template C++ APIs, and prioritize accessing
36+
C++ APIs from Carbon. This still will require major progress on the
37+
implementation of all the relevant Carbon features, and even design in some
38+
cases.
4139

42-
This objective and focus are oriented around the toolchain and implementation of
43-
Carbon. We still expect some work on language design, but for its priority to be
44-
driven largely as a function of being in the critical path of some aspect of our
45-
implementation work.
40+
The second is focused on moving from a vague direction of "we will have a memory
41+
safe dialect of Carbon that is a reasonable default", to a specific and concrete
42+
design. We want to be able to illustrate exactly what it will look like to
43+
migrate existing unsafe C++ to Carbon (possibly at large scale), and then begin
44+
incrementally adopting and integrating memory safety into that otherwise unsafe
45+
Carbon codebase.
4646

47-
## Key results in 2024
47+
Achieving these should dramatically reduce the risk around Carbon, especially in
48+
environments where memory safety is increasingly a necessary part of any future
49+
software development plans. They will also move the project much closer to our
50+
0.1 milestone.
4851

49-
### Carbon's toolchain implements enough of the language to build realistic code
52+
## Key results in 2025
5053

51-
This goal is not necessarily about complete support for the entire language
52-
design, but rather enough of it to support building the realistic and
53-
interesting Carbon code that interoperates with C++.
54+
### Access most non-template C++ APIs in Carbon
5455

55-
Here are some example language features that we think are key to success, but
56-
this is far from an exhaustive list:
56+
Beyond excluding templates, this excludes coroutines, and any aspects that
57+
require accessing Carbon types in C++ such as templates with Carbon types as
58+
template arguments.
5759

58-
- Imports and a working [prelude] (the earliest stages of a standard library)
59-
- Operator overloading and dispatch for expressions
60-
- Generic types and functions
61-
- Templates (likely only partial support and focused on interop use cases)
60+
This result includes both the implementation in the toolchain and the underlying
61+
design underpinning this implementation. It also includes implementation and
62+
design work on necessary Carbon language features that underpin the interop
63+
provided.
6264

63-
[prelude]: /docs/design#name-lookup-for-common-types
65+
### Access non-generic Carbon APIs in C++
6466

65-
### Carbon's toolchain can build C++ code
67+
This excludes generics to make the scope more tractable, but this remains a bit
68+
of a stretch goal for 2025, and how much progress we make will depend on how
69+
many unexpected difficulties we encounter getting the other direction to work,
70+
and any other delays.
6671

67-
We need the toolchain to be able to build C++ code as if it were Clang in order
68-
to build the C++ code that Carbon is interoperating with. This isn't about
69-
building anything new or novel, but about packaging and exposing Clang for this
70-
purpose.
72+
### Detailed safety strategy update, including expected tradeoffs and prioritization
7173

72-
### Carbon's toolchain works with existing, simple C++ build systems
74+
We haven't been focused on the safe side of Carbon for several years and will
75+
need to refresh our safety strategy to reflect the current plan, as well as
76+
expanding and making it more detailed to support building our initial memory
77+
safety design.
7378

74-
We should be able to drop Carbon's toolchain into at least simple `Makefile` or
75-
CMake build systems as a replacement for the C++ toolchain and provide a Carbon
76-
toolchain. This doesn't include supporting everything or even moderately complex
77-
builds; only the simplest of builds using these build systems need to work at
78-
first.
79+
### Design for compile-time temporal and mutation memory safety
7980

80-
### Carbon has a design and toolchain implementation of basic C++ interop
81+
We expect our memory safety story for temporal memory safety to at the highest
82+
level follow the direction of Rust, using the type system to ensure compile-time
83+
guarantees of safety without the runtime overhead of garbage collection or
84+
reference counting. We want our design here to cover both temporal and mutation
85+
safety. While the exact level of safety and the tradeoffs we're willing to
86+
accept will be part of updating our safety strategy, at a fundamental level we
87+
need to fully address the security requirements on memory safety, much like
88+
other modern languages including Swift, Kotlin, Go, or Rust. A significantly
89+
lower security bar won't be acceptable for the expected users of safe Carbon.
8190

82-
Our end goal is to compile a minimal but non-trivial example of bi-directionally
83-
mixing C++ and Carbon code such as our main example and run it successfully.
84-
However, completing everything involved in this example isn't expected to be
85-
realistic by the end of the year. We expect to work towards this example and in
86-
rough priority order across the following interop features and all the Carbon
87-
features they depend on:
91+
### Give talks at 2-3 conferences about Carbon topics, expanding our audience
8892

89-
- Calling C++ functions from Carbon.
90-
- Importing concrete C++ types as Carbon types.
91-
- (stretch) Using Carbon generics with a C++ type in Carbon.
92-
- (stretch) Calling Carbon functions from C++.
93-
- (stretch) Importing concrete Carbon types into C++.
93+
Beyond continuing to share details about Carbon with the open source and C++
94+
communities, we also want to expand our audience reach in 2025. We want to give
95+
talks at a conference in the Asia/Pacific region, and at a conference in the
96+
broader open source world beyond LLVM and C++ specific conferences.
9497

95-
### Give talks at 2-3 conferences covering 3-4 different Carbon topics
96-
97-
We want to continue to engage with the external C++ community as the Carbon
98-
toolchain becomes a more real and complete toolchain. We specifically want to
99-
share when interop becomes something people can experiment with and explore.
100-
101-
### Start building our initial tutorial and introductory material
102-
103-
Because of the nature of Carbon's experiment, the tutorial and introductory
104-
material won't be focused on typical teaching of the language to general
105-
developers. Instead, it will be focused on enabling C++ developers to start
106-
evaluating specific aspects of Carbon for interoperating with existing C++
107-
codebases.
108-
109-
We only expect to _start_ building this material in 2024. We want to learn what
110-
any critical gaps are for folks to start evaluating C++ interop and how best to
111-
close them going into 2025.
112-
113-
## Beyond 2024
98+
## Beyond 2025
11499

115100
Longer term goals are hard to pin down and always subject to change, but we want
116101
to give an idea of what kinds of things are expected at a high level further out
117-
in order to illustrate how the goals and priorities we have in 2024 feed into
102+
in order to illustrate how the goals and priorities we have in 2025 feed into
118103
subsequent years.
119104

120-
### Potential 2025 goals: ship a working [0.1 language] for evaluation
105+
### Potential 2026 goals: ship a working [0.1 language] for evaluation
121106

122107
[0.1 language]:
123108
/docs/project/milestones.md#milestone-01-a-minimum-viable-product-mvp-for-evaluation
124109

125-
As we adjust our schedule and roadmap to reflect the realistic rate of progress,
126-
the _earliest_ it seems feasible to have everything we need to evaluate the 0.1
127-
language is 2025. We're starting to be optimistic in 2024 that we'll be able to
128-
hit this in 2025, but ultimately this remains a lower bound. As we progress, we
129-
may discover things that push the schedule out further. That is the nature of an
130-
experimental project like Carbon.
110+
Because we are adding a design for memory safety to our 0.1 milestone, we are
111+
also expecting to push it out by at least a year. Shipping 0.1 in 2026 will be a
112+
very ambitious goal and may not be possible, but the end of 2026 is now the
113+
_soonest_ that 0.1 could realistically be ready to ship.
131114

132115
We expect that once we reach this milestone the community will be able to start
133116
realistically evaluating Carbon as a C++ successor language. Of course, this
134117
evaluation will take some time.
135118

136-
### Potential 2026-2027 goals: finish [0.2 language], stop experimenting
119+
### Potential 2027-2028 goals: finish [0.2 language], stop experimenting
137120

138121
[0.2 language]:
139122
/docs/project/milestones.md#milestone-02-feature-complete-product-for-evaluation
@@ -159,7 +142,7 @@ Some concrete goals that might show up in this time frame:
159142
- Create a foundation or similar organization to manage the Carbon project,
160143
separate from any corporate entities that fund work on Carbon.
161144

162-
### Potential goals _beyond_ 2027: ship [1.0 language] & organization
145+
### Potential goals _beyond_ 2028: ship [1.0 language] & organization
163146

164147
[1.0 language]:
165148
/docs/project/milestones.md#milestone-10-no-longer-an-experiment-usable-in-production

0 commit comments

Comments
 (0)