Commit Graph
23 Commits
Author SHA1 Message Date
Chandler CarruthandRichard Smith cfd1ed8484 Switch from Prettier to Rumdl for Markdown formatting (#7423)
Rumdl already appears to have _significantly_ fewer bugs than prettier,
and a solid LSP for editor integration.

The tool is: https://github.com/rvben/rumdl/

I've separated out the change across three commits for easier review.

The configuration tries to match the existing formatting, the changes to
the all the files are to correct issues found by the new tool.

Assisted-by: Antigravity with Gemini

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2026-06-26 21:42:01 +00:00
Chandler CarruthandRichard Smith 94d2c1c6d4 Make proposal filenames use 6 digits and include the title (#7245)
We've talked about adding the title to the filename several times over
the years and it seems really valuable. This requires us to compute a
"slug" for the title spelling that can be part of the filename.

Beyond that, we crossed 7000 recently, and so it seems likely that we
will need to add digits sooner rather than later here, so this goes
ahead and moves us to 6 digits so we don't have to adjust again for a
reasonable length of time.

To implement this and ensure we can sustain it going forward this adds a
tool to our pre-commit that validates (and corrects if needed) the
filename.

In order to update everything and keep links working, there are a _lot_
of changes, but the most interesting for direct review are in
`proposals/scripts`.

Assisted-by: Antigravity with Gemini

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2026-05-29 00:55:04 +00:00
Richard SmithandChandler Carruth e257051612 No predeclared identifiers, Core is a keyword (#4864)
Introduce a principle that the Carbon language should not encroach on
the
developer's namespace. Satisfy this principle by making `Core` a
keyword.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2025-02-01 03:03:30 +00:00
Jon Ross-Perkins d8ecc72d9d Update pre-commit config (#4549)
Skipping prettier because the relevant repo is archived and not working
well. Issues being fixed are from codespell.
2024-11-18 21:29:30 +00:00
Jon Ross-PerkinsandChandler Carruth d5ac724266 Document the export keyword (#4224)
This was approved in #3938

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2024-08-19 20:51:37 +00:00
Richard Smith 6bbbd4ec1f More consistent package syntax (#3927)
Change the syntax for `package` declarations from:

```carbon
[package Foo] [library "bar"] api;
[package Foo] [library "bar"] impl;
```

to

```carbon
[package Foo] [library "bar"];
impl [package Foo] [library "bar"];
```
2024-05-16 00:55:37 +00:00
6c812db05c Clarify name bindings in namespaces. (#3407)
-   Require namespace members be declared in the same name scope as the
    namespace is declared.
-   Allow binding patterns to directly declare names in namespaces.
-   Disallow using different namespaces in the same binding pattern.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2023-11-22 22:52:08 +00:00
Jon Ross-PerkinsandChandler Carruth 5943208f75 Change Main//default to an api file (#3403)
When there is no `package` directive, default to `Main//default api`
instead of
`Main//default impl`. This means:

- The extension will be `.carbon`, not `.impl.carbon`.
- There can only be one such file when compiling.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2023-11-16 18:57:45 +00:00
ea982ad2c8 Simplified package declaration for the Main package (#2550)
Make the preamble of simple programs more ergonomic, by removing the
`package Main` from the main package and removing the `package`
declaration
entirely from the main source file. Imports within a single package no
longer
need to, and are not permitted to, specify the package name.

Partially covers #2001 / #1136.
Covers #1869.
Supersedes #2265.
Addresses design idea #2323.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2023-07-06 21:55:54 +00:00
Josh Soref 066b103881 Spelling (#1580)
This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/carbon-lang/commit/38a1c1640151899fd6da0442a92557f9543b6280#commitcomment-79197316

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/carbon-lang/commit/173c8f9083a68aa61f7cfe94f720f1e5dc7f1ea3

Note: this PR does not include the action. If you're interested in running a spell check on every PR and push, that can be offered separately.

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-22 16:14:21 -07:00
Ryan Russell aa4ce80907 docs(design): improve readability (#1431)
Readability improvements focused on `docs/design/.md`

Signed-off-by: Ryan Russell <git@ryanrussell.org>
2022-07-19 17:45:45 -04:00
josh11b 9863cb98bb Make C++ import syntax match what we've been using in examples (#1397) 2022-07-15 13:47:37 -07:00
josh11b 16f9d82541 Fix binding syntax to be id: Type (#1381) 2022-07-12 10:14:11 -07:00
Jon Meowandjosh11b 24b763c7e8 Fix or remove invalid anchor links, adding pre-commit (#997)
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2022-01-05 15:00:02 -08:00
Jon MeowandChandler Carruth 6d33a80988 api file default public (#752)
Replace library public-like `api` behavior with explicit `private` behavior, mirroring #665 

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-09-21 09:33:32 -07:00
Jon Meow eb61412c79 Explicitly disallow self-imports by libraries (#794) 2021-09-03 17:01:52 -07:00
Geoff Romer e08beccc66 Use "package directive" and "import directive" (#808)
These aren't really statements (because they're not executed at run time), and it's debatable whether they're declarations, since their primary purpose isn't to introduce a name. On Discord, "directive" seemed to be the consensus choice for an alternate term.
2021-09-03 11:54:41 -07:00
Jon Meow c33994d1d1 Rewrite code and name organization alternatives/references (#724)
Alternatives just link to the proposal PR due to the legacy decision of putting alternatives in the doc.
2021-08-12 08:18:39 -07:00
Jon MeowandRichard Smith 231264e0c0 Remove : in variable declarations (#503)
Starting to apply #339

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2021-05-17 15:24:20 -07:00
Chandler CarruthandJon Meow a9c70c1057 Clean up references to the carbon-toolchain repository. (#226)
Now that we've centralized on a monorepo, tidy up some lingering
references.

For the `pr_comments.py` script, I've left the flag in place to select
a repository as it seems useful functionality to have available even if
we don't expect to need it in the near term. That said, I can pull it
out if folks prefer.

I haven't updated any of the *proposals* because it seems better to
leave those as-is from when they were written. The references seem
unlikely to be confusing to me. Happy for suggestions if needed there
though.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2020-12-15 16:27:31 -08:00
Jon Meow 79a9b51d07 Update pre-commits, add and address flake8 (#195)
Adopts new copyright and markdown toc checks.

The new toc check generates the toc header, so that's why all the md files changed (this had felt better to me for the long-term, more auto-generated content)
2020-11-13 16:34:23 -08:00
Jon Meow 94e065d9d2 Automated fixes using check-google-doc-style (#193)
With one manual ignore in the markdown style proposal, because it's explicitly listing disallowed terms.
2020-11-12 10:31:26 -08:00
Richard Smith ee7a108da4 Incorporate proposals #142 and #143 into the design
Add design text based on the contents of two proposals:

#142 Unicode source files
#143 Numeric literals
2020-11-03 16:39:05 -08:00