Commit Graph
29 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
Jon Meow 2f023b3479 Flesh out the conditionals doc (#655) 2021-07-29 15:31:36 -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
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
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 b3de19639d Fix/remove carbon-proposals links (#267)
Co-authored-by: Matthew Riley <mdriley@gmail.com>
2021-02-09 16:46:12 -08: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 f2d48f1bd0 Move the jekyll sidebar to a python script for consistent generation. (#205)
One implication here is that both proposals/README.md and the website should use basically the same format for their proposal lists. Another subtle change is that the website sidebar was previously sorted by *filename*, and is now sorted by *title*, which seems better because it's something that readers can see.

Enumerating why files change:

- gen_sidebar.py is the centerpiece, with a couple helpful functions for re-use elsewhere
- Delete the old sidebar html includes
- Modify the Makefile to handle gen_sidebar.py reasonably well (let's be honest... I'm not great at Makefiles)
- Move proposal listing out to its own file (proposals.py) for re-use
- Add a few PYTHONPATH things + `__init__.py` files to get modules importing correctly (may be a better way at this, I've hit a wall though).
2020-12-04 08:26:25 -08:00
Jon Meow b2f005c1bb Publish interop goals (#202)
This takes #175 and publishes it as interop goals. I've made a few small editorial changes, but the main addition is the "Offer equivalent support for languages other than C++" non-goal which I thought may be useful (in particular, it can be used to clarify why this directory is "interoperability" and not "interoperability_cpp").
2020-12-03 13:50:04 -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
Matt Godbolt 05afb1b1ec Fix markdown around link to BFloat16 (#178) 2020-10-27 09:15:33 -07:00
Jon Meow 4c43d63b8a Code and name organization (#107)
- [RFC](https://forums.carbon-lang.dev/t/rfc-code-and-name-organization/121)
- [Decision request](https://forums.carbon-lang.dev/t/request-for-decision-code-and-name-organization/140)
- [Examples doc](https://docs.google.com/document/d/1J8GX9uw5AxBz5Q22MLHJOfzLq4WJqKL-q1VwnKGHG-k/edit)
- [Approval announcement](https://forums.carbon-lang.dev/t/accepted-code-and-name-organization-107/150)

Files, packages, libraries, and imports for Carbon.

Contributors: chandlerc, fowles, tkoeppe, zygoloid
2020-10-14 10:52:24 -07:00
Jon Meow d031f3cdab An incomplete, early, and in-progress overview of the language design. (#83)
Co-authored by: chandlerc

- Based on [PR 22](https://github.com/carbon-language/carbon-lang/pull/83)
- [Idea topic](https://forums.carbon-lang.dev/t/proposal-for-an-incomplete-rough-high-level-overview-ready-for-early-feedback/52)
- [RFC](https://forums.carbon-lang.dev/t/rfc-an-incomplete-early-and-in-progress-overview-of-the-language-design/73)
- [Decision announcement](https://forums.carbon-lang.dev/t/accepted-an-incomplete-early-and-in-progress-overview-of-the-language-design/110)

This proposal should be considered a starting point of the language design. It's not intended to be final; language details may change. This is intended to offer a reasonable starting point for:

- Example code.
- Conceptualizing Carbon at a high level.
- Reasonable, but not necessarily final, approaches to features in README.md.
  - If any idea is obviously bad, we can clean it up here.

This proposal is not intended to achieve:

- A whole language design.
  - This is way too much work for a single proposal; this is a skeletal framework only.
  - As we work on feature-specific designs, we may decide to use other approaches. That's fine: we only need somewhere to start.
  - The summaries in README.md may be expected to change over time.
- Feature-specific files aren't intended to be well-written or comprehensive. They are a quick jot of prior thoughts.
  - We want to avoid getting stuck on language details that we should consider
    more carefully regardless. If you're passionate about a feature, please feel
    free to start a new proposal for it.
  - Each and every aspect of the suggested overview should be subject to careful
    examination and justification before it becomes a settled plan of record.

Chandler started this with https://github.com/carbon-language/carbon-lang/pull/22. I've taken it over with the following changes:

- More of a directory hierarchy.
- Trying to thin out the main file (now README.md) to lighter summaries of features.
- Details/rationale/alternatives should be in feature-specific files.
  - Draft files are linked as references where added.

For an example of how we may proceed with feature-specific designs, see https://github.com/carbon-language/carbon-lang/pull/80. In this structure:

- docs/design/README.md mentions interoperability, with a light overview.
  - The light overview is not yet in https://github.com/carbon-language/carbon-lang/pull/80.
- docs/design/interoperability/README.md goes into more depth on interoperability, covering key points of the approach.
- Individual files in docs/design/interoperability/* go into more depth on interoperability.

Simple designs may not have a subdirectory. All current feature-specific designs do not -- they may be moved later.
2020-07-30 11:37:15 -07:00