Commit Graph
104 Commits
Author SHA1 Message Date
josh11bandRichard Smith 48b7dc3b81 :! generic syntax (#676)
This implements decision #565 to use `T:! Type` to declare generic parameters, and `template T:! Type` for template parameters.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2021-08-04 14:27:11 -07:00
38eb2c0d2f Low context-sensitivity principle (#646)
Establish a principle that understanding the meaning and performance should not depend on expensive context, and explain what makes context expensive.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2021-08-03 10:20:46 -07:00
Jon Meow 2f023b3479 Flesh out the conditionals doc (#655) 2021-07-29 15:31:36 -07:00
Jon Meow 61abc44aef Mention the RFC project column in docs (#688)
Nothing is automating "ready for review" unfortunately, but the lack of RFC mention seems like a clear miss.
2021-07-29 10:57:21 -07:00
a725ae214d Add design style guide and a description of what belongs in the design versus in a proposal document. (#649)
Expand the description of the structure of a proposal PR. Clarify that
the full PR is the proposal, not only the P-numbered document. Start a
design style guide and use it to describe which parts of a proposal
should not end up in the design.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-07-26 11:58:40 -07:00
e932b7dcc3 Draft return docs (#620)
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-07-16 10:29:09 -07:00
josh11b 9e1816f9c0 Update method syntax in generics overview (#634)
* Implement #494 for overview.md
2021-07-15 08:55:02 -07:00
Jeremy G. Siek 2f950d279f fix a forgotten flipping of the parameter name and type (#643) 2021-07-14 16:09:53 -04:00
josh11b ffcdaf9aff Update code syntax in generics terminology (#633)
Reflects #565 and #494
2021-07-09 13:03:40 -07:00
josh11b 88c8877ff9 Update code syntax in generics goals (#632) 2021-07-09 13:00:47 -07:00
199c7e365c var ordering (#618)
Propose the decision from #542, noting implementation from #563

Also integrates some of #339 into `variables.md` because that's actually how this started, looking for a proposal reference for #542 

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2021-07-09 11:49:32 -07:00
josh11bandChandler Carruth d70297077b Update terminology in generics design docs (#610)
* implicit -> deduced
* type-type -> type-of-type
* extending/refining -> extending

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-06-29 13:23:35 -07:00
978e27f484 Generics overview (#524)
This adds an overview of a generics feature that attempts to achieve the goals from #24 . It has been summarized in these presentations:

- [non-type params](https://docs.google.com/presentation/d/1IZaDxP5Y3Wqprkyjzagv48tyxEeIcfz8FZS3Namsvew/edit#slide=id.p)
- [basic usage](https://docs.google.com/presentation/d/1OZiMTVW2Ommop5WTs9RyEwnGxy9yzaAPF7Cj5KUfDsY/edit?resourcekey=0-Nya0Soz3ZNs3hJan8VIrTA#slide=id.p)
- [more advanced usage](https://docs.google.com/presentation/d/1bg6q0Q9Sk4YpRbNA3D3H34xYtaEO8ScAUNUZK2UTi80/edit?resourcekey=0-6-Y6e1mfRUmHg-Zk65Gc5A#slide=id.p)

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Wolff Dobson <wolffg@users.noreply.github.com>
2021-06-29 10:52:45 -07:00
Geoff Romer d3b4358fd5 Update stacked pull request workflow. (#590)
This avoids having the stacked PR get auto-closed in step 7, and clarifies that you need to merge from trunk to the formerly-stacked PR in order to avoid spurious diffs.
2021-06-24 13:15:24 -07:00
Jon Meow 7af826e4df Update docs for pyenv and llvm (#570) 2021-06-10 08:32:15 -07:00
Chandler CarruthandJon Meow 05261b7fe7 Remove the LLVM bootstrap and use Hombrew installed LLVM-12. (#551)
Now that LLVM 12 has been released we no longer have any need to
bootstrap LLVM to get the desired featureset. LLVM 12 is available
widely, including in Homebrew across multiple platforms and in the
GitHub action runners.

Sadly, the Linux distribution builds of LLVM-12 are largely broken and
not as useful for us. The Homebrew Linux install was also broken
originally, but I've worked extensively with the Homebrew folks to get
the Linux install into a really good shape. It should now work reliably.

There are two primary bugs in Linux LLVM packages that need to be fixed
before we can just use them:

- https://bugs.llvm.org/show_bug.cgi?id=43604
- https://bugs.llvm.org/show_bug.cgi?id=46321

Once those are addressed and point releases with the fixes widely
available we can further simplify things.

Even with the need to use Homebrew installs, using the released LLVM has
the extra advantage of making it easy to properly support Darwin ARM and
I've added that configuration so that I can test things there.

Last but not least, this will significantly shrink our build outputs
which should allow building much more in continuous integration on
GitHub actions without exceeding the action cache size limits. I've even
added several tweaks and adjustments to the compile and build flags to
improve the build performance and reduce the build output size.

Once this is landed and stable, we can consider adding the refactoring
tooling back to our CI.

One of the biggest downsides of this path is that our CI has to download
and install the LLVM toolchain from Homebrew on each run. This is pretty
slow (takes a couple of minutes). But it is a fixed overhead -- it won't
get worse over time. Eventually, we can either look at a much fancier
action configuration to avoid this or hopefully the Debian packages will
get updated and we can move back to those.

The bootstrapping has served us long enough at this point. We can
resurrect it if we ever find a compelling reason for breaking off of the
latest LLVM release as our host toolchain.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2021-06-09 10:00:46 -07:00
Jon Meow 40f60e6591 Clean up vscode mentions and standardize install label (#569)
Also we don't use markdown-toc anymore.
2021-06-08 15:31:16 -07:00
josh11b c836ae78bb for uses in instead of :, and implement #542. (#563)
* `for` uses `in` instead of `:`, and implement #542.
2021-06-03 07:56:48 -07:00
josh11b 60fdda7aaf Update generics terminology to latest syntax (#560)
* Update generics terminology to latest syntax.
2021-06-03 07:54:44 -07:00
josh11b cf3c90ac3e Switch to name: type variable and parameter syntax in README.md. (#562) 2021-06-02 20:11:32 -07:00
Geoff Romer c903eb3133 Remove Void (#540)
Implements resolution of #443.
2021-06-01 12:48:04 -07:00
Jon Meow 93e7a37493 Start updating control flow design (#544) 2021-06-01 10:14:18 -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
Jon MeowandChandler Carruth c72c201133 Copy roadmap from proposal #253 (#533)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-05-14 09:52:16 -07:00
josh11bandRichard Smith fdb1893544 Generics terminology (#447)
To talk about generics as a programming language feature, you need a lot of
specialized terminology. We need to agree on the words we are using and their
meaning before we can meaningfully talk about the design of the feature itself.

There a number of problems a glossary solves:

Not everyone knows every term, so having a single place to look them up will
improve the ease of understanding, ease of contributing, and accessibility
of the project.
There may not be widespread agreement on the meaning of some terms. In
particular, individual programming languages tend to assign very specific
meanings to terms used within their ecosystem.
Some terms may be used in multiple ways, but we only use the term with one
specific meaning.
Some terms are our invention and we need to introduce them.


Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2021-05-10 16:42:01 -07:00
a6ddc03aa6 Generics goals (#24)
The "generics" feature of Carbon is a large design effort that needs to be broken up into manageable steps. The first thing we need is a high-level goals document. The goals here reflect the desirable properties that we have discovered as part of considering several alternative generics designs:

-   Use cases:
    -   Generic programming
    -   Upgrade path from C++ abstract interfaces
    -   Dependency injection
     -   Generics instead of open overloading and ADL
-   Performance
-   Better compiler experience
-   Encapsulation
-   Predictability
-   Dispatch control
-   Upgrade path from templates
-   Coherence
-   No novel name lookup
-   Learn from others
-   Interfaces are nominal
-   Interop and evolution
-   Bridge for C++ customization points

Goals are summarized in [this presentation](https://docs.google.com/presentation/d/12yGyu5Pvdag7CJp-_yLVkmbhyvuRIilBTNlkO0LKaHo/edit?usp=sharing&resourcekey=0-JB9yrUO4-6J8-zzGhnIyNg).

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Matthew Riley <mdriley@gmail.com>
Co-authored-by: austern <austern@google.com>
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2021-04-23 17:19:23 -07:00
Jon MeowandMatthew Riley a13cecccc6 Updates docs for community changes (#489)
- Generally replace Discourse mentions with GitHub Discussions, per #444 
- Switch from "Discord Chat" to just "Discord" because there's no more ambiguity, and "Discord" is the more common term.
- Fix mentions of "core team" to "Carbon leads" (because the touched docs overlap a lot).

Co-authored-by: Matthew Riley <mdriley@gmail.com>
2021-04-23 09:06:52 -07:00
Jon Meow f4ce5eafef Delete commenting guidelines, let code_review.md stand alone (#490)
Mainly I don't think this doc has been useful, and I think links that used to be there have drifted more towards code_review.md
2021-04-22 14:42:59 -07:00
Geoff Romerandjosh11b 6639a915dc Principle: Errors are values (#301)
A Carbon function that needs to report recoverable failures should return a sum type whose alternatives represent the success case and failure cases, such as Optional(T), Result(T, Error), or Bool. The function's successful return
value, and any metadata about the failure, should be embedded in the alternatives of the sum type, rather than reported by way of output parameters or other side channels. Carbon's design will prioritize making this form of error handling efficient and ergonomic.

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2021-04-21 13:00:03 -07:00
Jon Meow 37f94c964d Update evolution doc for #426 (#469)
A lot of text is mirrored over, but also some nuanced adjustments. @chandlerc and I have been working on this [in Docs](https://docs.google.com/document/d/1n6xVPKQDuTpMuMoK0BnQ8jtEaBhDo9Y50gYb1zyG-_s/edit).
2021-04-19 16:42:44 -07:00
Jon Meow f2c3f68813 Fix repo/respository (#452) 2021-04-14 14:46:51 -07:00
Jon Meow b4593f5133 Add pip_install to the build. (#435)
Updates corresponding tool instructions.
2021-04-07 09:08:02 -07:00
Chandler CarruthandJon Meow 251402ceb7 Make Python 3.6 our minimum version and fix tests. (#401)
This matches the version on Ubuntu LTS and other OSes. The only problem
I found with it in our testing is that Bazel confusingly sets the locale
to use `LANG=en_US` by default which breaks UTF-8 support. We may need
to shift this on Windows, but this seems like a reasonable first step.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2021-03-19 00:58:46 -07:00
Dave Abrahams 18690b43bb Bison/Flex are now installed and built by bazel. 2021-03-04 10:12:18 -08:00
Dave Abrahams 3078f34f5e Shallow clone submodules. 2021-03-04 10:09:29 -08:00
Jon Meow 1edfb1786e Language-level safety strategy (#196)
-   Based on [#130](https://github.com/carbon-language/carbon-lang/pull/130) from chandlerc
-   [RFC](https://forums.carbon-lang.dev/t/rfc-language-level-safety-strategy-196/182)
-   [Decision](https://forums.carbon-lang.dev/t/request-for-decision-language-level-safety-strategy/196)
-   [Approval annnouncement](https://forums.carbon-lang.dev/t/accepted-language-level-safety-strategy/201)
2021-03-03 15:00:23 -08:00
Dave Abrahams 4383b9fd92 Doc: make tools needed by tests required/add validation check 2021-02-26 13:15:05 -08:00
Jon Meow 23009d3b06 Stop using 'Review manager requests', adjust some minor advice bits. (#293) 2021-02-25 11:15:13 -08:00
Jon MeowandChandler Carruth 50fa120c87 Add style guideline for using std::foo; (#263)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-02-22 10:38:54 -08:00
Jon Meow 6e5070de18 Adapting jsiek's executable semantics tooling for commit. (#237)
Notes versus what jsiek wrote:

- This adopts Bazel for building.
    - System-local versions of bison/flex are used. I found https://github.com/jmillikin/rules_bison, but those print a lot of warnings (things like -Wsign-compare IIRC) which makes builds hard to read. Plus I think the underlying bison_cc_library rule didn't work, so this would really only get a hermetic bison/flex build (helpful, but didn't seem worth more time).
    - I'm adding in a .bazeliskrc to push a somewhat more standard choice of bazel versions. I noticed I was getting unstable versions by default, possible Google-specific, but seemed good to include.
    - The `-lpthread` kludge.
- Turn all of the examples into golden tests.
    - Including adding a golden test rule.
- Fixed various style guide issues. For example:
    - Fixing function names to be CamelCase instead of snake_case (https://google.github.io/styleguide/cppguide.html#Function_Names)
    - Removed exception use (https://google.github.io/styleguide/cppguide.html#Exceptions)
    - File name fixes (https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/cpp_style_guide.md#file-names)
- Dropped `using` of `std` names -- I believe this is preferred (maybe we should be explicit about this in the Carbon style guide)
- Switched `enum` uses to `enum class` for ease-of-identification.
- Spent some time breaking out files to hopefully be easier to read/edit pieces, and understand relations between structs.
- Added `code requires` to `syntax.ypp` to address include issues

Possibly other things -- but the fundamental structure is, I believe, unchanged. I put in the golden tests pretty early to ensure I wasn't mutating output/results.
2021-02-19 15:25:43 -08:00
Jon Meow 7a1abddb4f Clarify code review applies to docs in CONTRIBUTING (#262)
And add note about rebasing issues
2021-02-10 10:36:36 -08:00
Jon MeowandMatthew Riley b3de19639d Fix/remove carbon-proposals links (#267)
Co-authored-by: Matthew Riley <mdriley@gmail.com>
2021-02-09 16:46:12 -08:00
Jon MeowandChandler Carruth f58e5da827 Modify clang detection to build clang (#261)
Per chandlerc's comment:

First, this builds inside the Bazel tree rather than in the source
repository. This ensures we start in a clean directory each time the
repository rule is run again. We don't need to detect an existing build
with this, and it will only be rebuilt when the workspace file or the
repository rule implementation is changed. This can be forced by using:
```
bazel sync --configure
```

Second, we use an implicit dependency on the `WORKSPACE` file to locate
the workspace directory automatically, and the `HEAD` file from the
`llvm-project` submodule to trigger a rebuild if the submodule is
updated.

Third, teach the CMake script to try to use a system-installed `clang`
if installed and not overridden by the `CC` environment variable. This
is very different from the prior logic -- this is only used with the
CMake build, and so should work with any system C++ compiler that can
build Clang and LLVM.

Lastly, this tweaks the CMake options to tune this build given that we
now fully control it and it will only be used in this context. This
still results in a 1.5gb build for me. =/ But its as small as I can make
it really. It's a frustrating long list, but I couldn't find a more
brief way of representing this.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-02-08 17:17:58 -08:00
Jon Meow 299e5e2f83 Remove text about creating open question issues without a decision. (#247)
This isn't reflected in the above text, not sure how it managed to remain. There is still a note about filing issues for open questions at https://github.com/carbon-language/carbon-lang/blob/trunk/docs/project/consensus_decision_making.md#formal-decision-content, but I think it's much clearer when it's part of the core team's decision, rather than during proposal iteration.
2021-02-08 16:16:28 -08:00
Jon Meow b24e694ba2 Flesh out advice on package managers, add fsmonitor/ninja. (#246) 2021-02-05 16:26:03 -08:00
Jon Meow efef7cae16 Detect if there's a built version of clang within the workspace (#260) 2021-02-05 15:15:51 -08:00
Matt Godbolt 769c6b4c01 Update path for llvm-project (#255) 2021-02-05 14:37:17 -08:00
Matthew Riley d1f4b15aab Use new name for "Google Meet" (#241)
https://www.theverge.com/2020/4/8/21214059/google-hangouts-meet-rebrand-video-chat-conferencing
2021-01-27 20:12:53 -08:00
Matthew Riley c2ec084d07 Add mmdriley as review manager (#242)
As discussed at https://forums.carbon-lang.dev/t/looking-for-additional-review-managers
2021-01-27 20:12:25 -08:00
Jon Meow 6ba2f5851c Document more tools (#240)
- bazel/bazelisk because it's kinda needed
- buildifier per #236 
- Clang/LLVM I know a number of people are familiar with, but I wasn't...
- `go get` and `pip` because it's feeling more and more appropriate to separate out package managers vs other tools
2021-01-27 09:51:11 -08:00