@@ -16,55 +16,117 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
16
16
- [ Problem] ( #problem )
17
17
- [ Background] ( #background )
18
18
- [ Proposal] ( #proposal )
19
- - [ Details] ( #details )
20
19
- [ Rationale] ( #rationale )
21
20
- [ Alternatives considered] ( #alternatives-considered )
21
+ - [ Use a branch to refer to the explorer codebase] ( #use-a-branch-to-refer-to-the-explorer-codebase )
22
+ - [ Do nothing] ( #do-nothing )
22
23
23
24
<!-- tocstop -->
24
25
25
26
## Abstract
26
27
27
- TODO: Describe, in a succinct paragraph, the gist of this document. This
28
- paragraph should be reproduced verbatim in the PR summary.
28
+ The explorer codebase is no longer actively developed or maintained, but retains
29
+ value as a place to look for implementations of various parts of the design.
30
+ Having both the explorer and toolchain in the working git repository causes
31
+ confusion for developers and users, and increases our incremental maintenance
32
+ burden. We will move explorer out of the working git repository so that it
33
+ remains accessible but is clearly deliniated from the toolchain and is more
34
+ clearly frozen or archived.
29
35
30
36
## Problem
31
37
32
- TODO: What problem are you trying to solve? How important is that problem? Who
33
- is impacted by it?
38
+ Users have expressed confusion when they come across examples or tests for the
39
+ explorer that involve ` Main() ` , whereas the design and implementation of the
40
+ toolchain have moved on to ` Run() ` as the entry point.
41
+
42
+ Developers have attempted to update the explorer codebase to fix style guide
43
+ issues[ ^ 1 ] , as tools like grep or clang-tidy do not differentiate our active
44
+ toolchain codebase from the frozen explorer one.
45
+
46
+ As we update Bazel, Clang, Clang-tidy, etc, we also have to update the explorer
47
+ codebase to keep it building cleanly.
48
+
49
+ As we modify the ` //testing ` harness, we have to accommodate and work around the
50
+ explorer tests[ ^ 2 ] [ ^ 3 ] [ ^ 4 ] .
51
+
52
+ [ ^ 1 ] : https://github.com/carbon-language/carbon-lang/pull/5224
53
+
54
+ [ ^ 2 ] : https://github.com/carbon-language/carbon-lang/pull/4979
55
+
56
+ [ ^ 3 ] : https://github.com/carbon-language/carbon-lang/pull/5025
57
+
58
+ [ ^ 4 ] : https://github.com/carbon-language/carbon-lang/pull/5036
34
59
35
60
## Background
36
61
37
- TODO: Is there any background that readers should consider to fully understand
38
- this problem and your approach to solving it?
62
+ - Previous proposal:
63
+ [ p3532: Focus implementation effort on the toolchain] ( https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md )
64
+ - Kick-off of this discussion
65
+ [ #5224 ] ( https://github.com/carbon-language/carbon-lang/pull/5224#pullrequestreview-2730512195 )
66
+ - Discord discussion:
67
+ [ 2025-04-02 #explorer] ( https://discord.com/channels/655572317891461132/763516049710120960/1356979197070803095 )
39
68
40
69
## Proposal
41
70
42
- TODO: Briefly and at a high level, how do you propose to solve the problem? Why
43
- will that in fact solve it?
44
-
45
- ## Details
71
+ 1 . Add a tag ` explorer-archived ` in the main ` carbon-lang ` git repository.
72
+ 2 . Copy the ` //explorer ` directory and its dependencies to a new ` explorer `
73
+ repository under the ` carbon-language ` organization.
74
+ 3 . Locally ensure the explorer tests build and pass under the ` explorer `
75
+ repository.
76
+ 4 . Add a ` README.md ` to the ` explorer ` repository that explains explorer is
77
+ archived and not under active development.
78
+ 5 . Delete ` //explorer ` in the main ` carbon-lang ` repository.
46
79
47
- TODO: Fully explain the details of the proposed solution.
80
+ Note that fuzzer test cases from the explorer are already relocated under
81
+ ` //toolchain/*/fuzzer_corpus/ ` .
48
82
49
83
## Rationale
50
84
51
- TODO: How does this proposal effectively advance Carbon's goals? Rather than
52
- re-stating the full motivation, this should connect that motivation back to
53
- Carbon's stated goals and principles. This may evolve during review. Use links
54
- to appropriate sections of [ ` /docs/project/goals.md ` ] ( /docs/project/goals.md ) ,
55
- and/or to documents in [ ` /docs/project/principles ` ] ( /docs/project/principles ) .
56
- For example:
57
-
58
- - [ Community and culture] ( /docs/project/goals.md#community-and-culture )
59
- - [ Language tools and ecosystem] ( /docs/project/goals.md#language-tools-and-ecosystem )
60
- - [ Performance-critical software] ( /docs/project/goals.md#performance-critical-software )
61
- - [ Software and language evolution] ( /docs/project/goals.md#software-and-language-evolution )
62
- - [ Code that is easy to read, understand, and write] ( /docs/project/goals.md#code-that-is-easy-to-read-understand-and-write )
63
- - [ Practical safety and testing mechanisms] ( /docs/project/goals.md#practical-safety-and-testing-mechanisms )
64
- - [ Fast and scalable development] ( /docs/project/goals.md#fast-and-scalable-development )
65
- - [ Modern OS platforms, hardware architectures, and environments] ( /docs/project/goals.md#modern-os-platforms-hardware-architectures-and-environments )
66
- - [ Interoperability with and migration from existing C++ code] ( /docs/project/goals.md#interoperability-with-and-migration-from-existing-c-code )
85
+ The primary purpose of the explorer codebase at this time is as a demonstration
86
+ of past work implementing the carbon language design. This can help to inform
87
+ the implementation of the toolchain as it catches up in various areas, as long
88
+ as the design has not deviated from the explorer implementation.
89
+
90
+ Searching in, and providing links to the explorer codebase comes up in design
91
+ discussions occasionally [ ^ 5 ] , and we should maintain the ability of toolchain
92
+ developers to look through the explorer easily. The primary place they do so is
93
+ on github, where the code can be linked to. Github search only works
94
+ [ on the main branch] ( https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax#using-qualifiers )
95
+ of a repository, so the ` trunk ` branch for the ` carbon-lang ` repository. To
96
+ maintain searchability, the explorer codebase must either remain on ` trunk ` in
97
+ ` carbon-lang ` or in a sibling repository.
98
+
99
+ Proposal
100
+ [ p3532] ( https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md )
101
+ directed to keep the explorer codebase active in the main repository, with its
102
+ tests building and running:
103
+
104
+ > We should keep the Explorer's code in place, building, and passing its basic
105
+ > regression tests because the built artifacts of the Explorer remain really
106
+ > valuable given its coverage of our design's feature sets.
107
+
108
+ However the [ problems] ( #problem ) discussed above result from this situation. We
109
+ can gain the benefit of access to the codebase while reducing its impact on
110
+ developers and users by moving it into a separate git repository.
111
+
112
+ [ ^ 5 ] :
113
+ https://discord.com/channels/655572317891461132/941071822756143115/1349523309682753606
67
114
68
115
## Alternatives considered
69
116
70
- TODO: What alternative solutions have you considered?
117
+ ### Use a branch to refer to the explorer codebase
118
+
119
+ We could create a branch in the ` carbon-lang ` repository that contains explorer,
120
+ but delete it from ` trunk ` . This would also allow the code to be found and
121
+ linked to, however GitHub search does not support searching in a branch. The
122
+ main purpose of the explorer code while archived is for reading the
123
+ implementation, and search is an important part of that.
124
+
125
+ ### Do nothing
126
+
127
+ If, in the future, we want to restart development of the explorer codebase, we
128
+ will benefit from keeping the codebase building as we upgrade Bazel, Clang,
129
+ Clang-tidy, etc. However we don't currently have the resources to build two
130
+ implementations of the language, and there's no plan in our roadmaps to restart
131
+ explorer development. So the cost of letting the explorer codebase become stale
132
+ is outweighed by the costs of keeping it active.
0 commit comments