|
| 1 | +# Move explorer out of toolchain git repository |
| 2 | + |
| 3 | +<!-- |
| 4 | +Part of the Carbon Language project, under the Apache License v2.0 with LLVM |
| 5 | +Exceptions. See /LICENSE for license information. |
| 6 | +SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | +--> |
| 8 | + |
| 9 | +[Pull request](https://github.com/carbon-language/carbon-lang/pull/5270) |
| 10 | + |
| 11 | +<!-- toc --> |
| 12 | + |
| 13 | +## Table of contents |
| 14 | + |
| 15 | +- [Abstract](#abstract) |
| 16 | +- [Problem](#problem) |
| 17 | +- [Background](#background) |
| 18 | +- [Proposal](#proposal) |
| 19 | +- [Rationale](#rationale) |
| 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) |
| 23 | + |
| 24 | +<!-- tocstop --> |
| 25 | + |
| 26 | +## Abstract |
| 27 | + |
| 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. |
| 35 | + |
| 36 | +## Problem |
| 37 | + |
| 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 |
| 59 | + |
| 60 | +## Background |
| 61 | + |
| 62 | +- Previous proposal: |
| 63 | + [#3532: 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) |
| 68 | + |
| 69 | +## Proposal |
| 70 | + |
| 71 | +1. Add a tag `explorer-archived` in the main `carbon-lang` git repository. |
| 72 | +2. Create a new `explorer` repository under the `carbon-language` organization |
| 73 | + that only contains the `//explorer` and `//installers` directories and their |
| 74 | + dependencies at head. |
| 75 | +3. Locally ensure the explorer tests build and pass under the `explorer` |
| 76 | + repository. |
| 77 | +4. Add a `README.md` to the `explorer` repository that explains explorer is |
| 78 | + archived and not under active development. |
| 79 | +5. Stop building, or remove the "Explorer (trunk)" compiler option from |
| 80 | + [carbon.compiler-explorer.com](https://carbon.compiler-explorer.com). |
| 81 | +6. Delete `//explorer` and `//installers` in the main `carbon-lang` repository. |
| 82 | +7. Archive the `explorer` repository in GitHub, making it read-only. |
| 83 | + |
| 84 | +Note that fuzzer test cases from the explorer are already relocated under |
| 85 | +`//toolchain/*/fuzzer_corpus/`. |
| 86 | + |
| 87 | +## Rationale |
| 88 | + |
| 89 | +The primary purpose of the explorer codebase at this time is as a demonstration |
| 90 | +of past work implementing the carbon language design. This can help to inform |
| 91 | +the implementation of the toolchain as it catches up in various areas, as long |
| 92 | +as the design has not deviated from the explorer implementation. |
| 93 | + |
| 94 | +Searching in, and providing links to the explorer codebase comes up in design |
| 95 | +discussions occasionally [^5][^6][^7][^8][^9][^10], and we should maintain the |
| 96 | +ability of toolchain developers to look through the explorer easily. The primary |
| 97 | +place they do so is on GitHub, where the code can be linked to. GitHub search |
| 98 | +only works |
| 99 | +[on the main branch](https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax#using-qualifiers) |
| 100 | +of a repository, so the `trunk` branch for the `carbon-lang` repository. To |
| 101 | +maintain searchability, the explorer codebase must either remain on `trunk` in |
| 102 | +`carbon-lang` or in a sibling repository. GitHub search does continue to work in |
| 103 | +archived repositories. |
| 104 | + |
| 105 | +Proposal |
| 106 | +[p3532](https://github.com/carbon-language/carbon-lang/blob/trunk/proposals/p3532.md) |
| 107 | +directed to keep the explorer codebase active in the main repository, with its |
| 108 | +tests building and running: |
| 109 | + |
| 110 | +> We should keep the Explorer's code in place, building, and passing its basic |
| 111 | +> regression tests because the built artifacts of the Explorer remain really |
| 112 | +> valuable given its coverage of our design's feature sets. |
| 113 | +
|
| 114 | +However the [problems](#problem) discussed above result from this situation. We |
| 115 | +can gain the benefit of access to the codebase while reducing its impact on |
| 116 | +developers and users by moving it into a separate git repository. |
| 117 | + |
| 118 | +[^5]: |
| 119 | + https://discord.com/channels/655572317891461132/998959756045713438/1225116234199203860 |
| 120 | + |
| 121 | +[^6]: |
| 122 | + https://discord.com/channels/655572317891461132/998959756045713438/1237143981150830673 |
| 123 | + |
| 124 | +[^7]: |
| 125 | + https://discord.com/channels/655572317891461132/709488742942900284/1250577021474443376 |
| 126 | + |
| 127 | +[^8]: |
| 128 | + https://discord.com/channels/655572317891461132/748959784815951963/1255669935439482993 |
| 129 | + |
| 130 | +[^9]: |
| 131 | + https://discord.com/channels/655572317891461132/655578254970716160/1302033729761443963 |
| 132 | + |
| 133 | +[^10]: |
| 134 | + https://discord.com/channels/655572317891461132/941071822756143115/1349523309682753606 |
| 135 | + |
| 136 | +## Alternatives considered |
| 137 | + |
| 138 | +### Use a branch to refer to the explorer codebase |
| 139 | + |
| 140 | +We could create a branch in the `carbon-lang` repository that contains explorer, |
| 141 | +but delete it from `trunk`. This would also allow the code to be found and |
| 142 | +linked to, however GitHub search does not support searching in a branch. The |
| 143 | +main purpose of the explorer code while archived is for reading the |
| 144 | +implementation, and search is an important part of that. |
| 145 | + |
| 146 | +### Do nothing |
| 147 | + |
| 148 | +In the future, we may want to restart development of the explorer codebase. At |
| 149 | +that time we would benefit from keeping the codebase building as we upgrade |
| 150 | +Bazel, Clang, Clang-tidy, etc. However we don't currently have the resources to |
| 151 | +build two implementations of the language, and there's no plan in our roadmaps |
| 152 | +to restart explorer development. So the cost of letting the explorer codebase |
| 153 | +become stale is outweighed by the costs of keeping it active. |
0 commit comments