Commit Graph
63 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
Richard SmithandChandler Carruth 86ae4c6053 And, or, not (#680)
Proposal: use `and`, `or`, and `not` keywords in place of `&&`, `||`, `!`.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-08-03 15:37:18 -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
cc56afb79e Require braces (#623)
Require braces, never optional, particularly in control flow like `if`/`else`.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-07-22 10:42:54 -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
Richard SmithandChandler Carruth db2efeafeb Operator tokens (#601)
Proposal: lexical rules for operator tokens.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-07-08 10:39:36 -07:00
Jon Meow 696f8f1fce Fix p0540 filename (#619) 2021-07-02 14:54:59 -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
Richard Smith 7200e36781 Proposal for a partial ordering for operator precedence (#555) 2021-06-25 14:53:24 -07:00
4cf495cee6 Initialization of memory and variables (#257)
This proposal outlines a suggested design for initialization in Carbon.

The early draft was developed in the document here:
https://docs.google.com/document/d/1UkDu1Wo5qsmedgt-gZyINdOV5Qc8nICpltZ_TZfTo40/edit#

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Geoff Romer <gromer@google.com>
2021-06-21 21:34:27 -07:00
Richard Smith 4911ede826 Proposal: return; should be valid only in functions with no declared return type. 2021-06-02 11:38:29 -07:00
59add8c8de Add statement syntax for function declarations (#438)
Add statement syntax (either `fn` or `func`, see proposal) for function declarations.

- Follows C++-style trailing return syntax.

Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2021-05-19 14:43:11 -07:00
66e5083b4b Add C++-like for loops (#353)
Add C++-like `for` loops

-  Omits `for (;;)` syntax for now.

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: austern <austern@google.com>
2021-05-14 15:38:45 -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
Matthew Riley cd8cc97185 return (#415)
Define syntax for `return` in Carbon.
2021-05-07 14:27:21 -07:00
9d1863efb7 Add var <type> <identifier> [ = <value> ]; syntax for variables (#339)
Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: austern <austern@google.com>
2021-04-28 13:46:26 -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 MeowandChandler Carruth 5a2db81039 Switch from Discourse Forums to GitHub Discussions (#444)
Switch from Discourse Forums to GitHub Discussions

For use of https://github.com/carbon-language/carbon-lang/discussions

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-04-22 09:56:26 -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 7e81fb9c62 Add C++-like while loops (#340)
Add C++-like `while` loops

- Omits variable declarations in condition syntax (`while (auto x = DoSomething())`).
2021-04-21 10:06:44 -07:00
Jon Meow d60389babd Stop generating decisions into the proposal index (#462) 2021-04-14 15:14:43 -07:00
dbf59bff6f Governance & evolution revamp (#426)
This proposal revamps Carbon's governance structure and evolution
process to try to make it significantly more efficient, friendly,
welcoming, and effective. Proposal process and RFCs are structured much
closer to a traditional code review. The review is driven by a Carbon
lead, although they may delegate some aspects and anyone in the
community is encouraged to participate. Resolving issues in order to
make a decision is handled with GitHub issues and through consensus
among a very small, focused team of leads. It also tries to encourage
explicitly showing interest and enthusiasm in Carbon proposals.

See the proposal text for all the details!

Many thanks to @KateGregory, @jonmeow, @mmdriley, and @zygoloid for
their early ideas and suggestions that ended leading to the direction of
this proposal. I also want to specifically thank them for challenging my
initial direction. 🙂

My plan is to update documentation, `CODEOWNERS`, and other
implementation details in follow-up PRs, but I'm happy to roll any of
them into this one where useful.

Landing as this was accepted by the core team, and reviewed by both a
Carbon lead and review manager so is covered in both processes.

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2021-04-13 20:57:17 -07:00
Jon Meow 6df0d51516 if/else (#285) 2021-03-24 16:02:22 -07:00
Matthew Riley cfe52b5705 Decision for #253 (#374) 2021-03-22 12:09:19 -07:00
Jon Meow 41786eae25 Decision for Comments #198 (#275) 2021-03-15 09:53:15 -07:00
Chandler CarruthandDave Abrahams fa099f527e Proposed Carbon roadmap for 2021 (#253)
This document tries to lay out a high-level roadmap for Carbon in 2021
following the [roadmap process](/docs/project/roadmap_process.md).

Co-authored-by: Dave Abrahams <dabrahams@google.com>
2021-03-12 19:28:01 -08:00
Matthew Riley c38a027368 Update proposals list
PR #280 committed the decision for #199. #199 had the proposal and no decision
and modified `README.md`. #280 had a decision but no proposal, and *didn't*
update `README.md`. However, in a tree with both the proposal *and* its
decision, another modification is necessary.

Since only one PR modified `README.md`, there wasn't a merge conflict that
required a rebase. And since there was no rebase, each PR ran its own CI
blissfully unaware of the other.

For now, committing the results of `pre-commit run --all-files` on trunk.
Later, will look into ways to make the proposal+decision workflow less likely
to break trunk.
2021-03-10 12:10:24 -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
Richard Smith 6a2f7c9984 Comments proposal (#198)
Proposal as accepted by core team on 2021-02-19.
2021-03-01 15:32:38 -08:00
Richard Smith ec6fde4d61 String literals proposal (#199)
Proposal as accepted by core team on 2021-02-23.
2021-03-01 12:10:55 -08:00
Geoff Romer 5fade567c8 Design direction for sum types (#157)
Directional proposal for supporting sum types in Carbon
2021-02-10 11:55:57 -08:00
Chandler Carruth 51b98b1fe4 Update proposal list after #179. (#239)
I thought the PR checks would have caught and prevented this, but
I think it predated them or they didn't catch it.
2021-01-16 18:33:40 -08:00
5db229afc6 Create an implementation team. (#179)
Create a team to oversee the implementation of Carbon. This team is
responsible for code reviews as well as handling any implementation-specific
decisions.

Originally, it was suggested to call this a "toolchain" team. During
discussion, it became clear that the scope wasn't easily limited to
implementation efforts that were necessarily part of the toolchain. There are
many different aspects of implementation, and we anticipate code sharing
between them that make it unhelpful to try to separate these. Instead, this
team is chartered with broadly covering all of the implementation concerns in
Carbon. If someone is concerned that an issue is larger than that, perhaps
impacting the design of the language, the project, or the community, the
standard process already provides for easy escalation to the core team.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: austern <austern@google.com>
Co-authored-by: Geoff Romer <gromer@google.com>
2021-01-16 16:06:39 -08:00
Sidney HummertandChandler Carruth 73791d4784 Decision for #175: C++ interoperability goals (#200)
* Decision for #175: C++ interoperability goals

* Update proposals/p0175_decision.md

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>

* Prettified suggested changes

* Update table of contents

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2020-12-08 17:22:20 -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 1a85ea2225 Decision for: Basic Syntax #162 (#190)
- [Proposal PR](https://github.com/carbon-language/carbon-lang/pull/162)
- [RFC topic](https://forums.carbon-lang.dev/t/rfc-basic-syntax/142)
- [Decision request](https://forums.carbon-lang.dev/t/request-for-decision-basic-syntax-162/165)
- [Decision announcement](https://forums.carbon-lang.dev/t/accepted-basic-syntax-162/170)

Tracking issues filed as part of decision:

- Should there be a function type? #191
- Should types be values? #192

Finalized on 2020-11-24
2020-12-01 13:18:59 -08:00
136a8ae470 Basic Syntax (#162)
* first draft of proposal for basic syntax

* rename proposal

* formating

* fixing typos

* precendence and associativity

* minor edit

* added abstract syntax

* some revisions based on feedback from meeting today

* optional return type

* oops, not optional for function declarations

* replacing abbreviations with full names

* name changes

* Update proposals/p0162.md

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>

* removed = from precedence table

* for fun decl, back to optional return type, shorthand for void return

* more fiddling with return types

* change base case of statement_list to empty

* added pattern non-terminal

* added  expression style function definitions

* change && to and, || to or

* change  and  to have equal precedence

* updating text to match grammar, fix typo in grammar regarding pattern

* adding trailing comma thing to tuples

* removed 'alt' keyword, not necessary

* flipped expression and pattern

* added period for named arguments and documented the reason

* change alternative syntax to use tuple instead of expression

* comment about abstract syntax

* code block language annotations

* added alternative designs, some cleanup for pre-commit

* spell checking

* filled out the TOC

* minor edits

* minor edit

* trying to fix pre-commit error

* changes from pre-commit?

* changes based on meeting today

* describe alternatives regarding methods

* more rationale in discussion of alternatives

* addressing comments

* typo fix, added text about next steps

* removed *, changed a ! to not

* Update proposals/p0162.md

Co-authored-by: Geoff Romer <gromer@google.com>

* edits from feedback

* pre-commit

* added second reason for period in field initializer

* added executable semantics, fixed misunderstanding regarding associativity

* update README

* added a paragraph about tuples and tuple types

* Update proposals/p0162.md

Co-authored-by: josh11b <josh11b@users.noreply.github.com>

* addressing comments from josh11b

* Update executable-semantics/README.md

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>

* link to implicit parameters in generics proposal

* added non-terminal for designator as per geoffromer's suggestion

* changed handling of tuples in function call and similar places as per josh11b and zygoloid

* moving code to separate PR

Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2020-12-01 11:55:48 -05:00
Jon Meow e195b35a73 C++ interoperability goals (#175)
Related threads:

-  From austern, [Initial draft of C++ Interoperability principles doc #62](https://github.com/carbon-language/carbon-lang/pull/62)
-  From me, [Carbon <-> C/C++ interoperability #80](https://github.com/carbon-language/carbon-lang/pull/80)
    - [Doc](https://docs.google.com/document/d/1va8VgvDdA966WG3znJyUrlComYqNfNBV7__hUd9XxxU/edit)
    - [Ideas topic](https://forums.carbon-lang.dev/t/draft-carbon-c-c-interoperability/77)
    - [RFC topic](https://forums.carbon-lang.dev/t/rfc-carbon-c-c-interoperability/89)
- From chandlerc, [Interop implementation strategies](https://forums.carbon-lang.dev/t/interop-implementation-strategies/108)

For this PR:

- [RFC topic](https://forums.carbon-lang.dev/t/rfc-c-interoperability-goals-175/156)
- [Decision topic](https://forums.carbon-lang.dev/t/request-for-decision-c-interoperability-goals/171)
- [Decision announcement](https://forums.carbon-lang.dev/t/accepted-c-interoperability-goals/175)
- [Decision PR](https://github.com/carbon-language/carbon-lang/pull/200)
2020-11-25 09:06:44 -08:00
Sidney HummertandJon Meow 7b7cf1a10b Decision for 0063: Criteria for Carbon to go public (#187)
* Decision for 0063: Going Public

* Update proposals/p0063_decision.md

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>

* Update proposals/p0063_decision.md

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>

* Update p0063_decision.md

* Update README.md

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2020-11-19 10:41:22 -08:00
Bryce Adelstein Lelbach aka wash b8750e6c4b Criteria for Carbon to go public (#63)
- [Google Doc](https://docs.google.com/document/d/1Uir4sc1HuT5pOzRrFDnbuClzSYBEwE2Unbabr28e8iw/edit)
- [Ideas](https://forums.carbon-lang.dev/t/going-public-doc/139)
- [RFC](https://forums.carbon-lang.dev/t/rfc-criteria-for-carbon-to-go-public/146)
- [Decision announcement](https://forums.carbon-lang.dev/t/accepted-criteria-for-carbon-to-go-public/167)
2020-11-17 14:13:46 -08:00
f44cf22924 Add a C++ style guide for the project (#113)
When writing C++ code for Carbon, we want to keep all of our code consistent,
easy to learn, and help avoid spending undue code review time arguing about
the same core style and idiomatic issues.

This adopts the Google C++ style guide as a baseline, and then makes minimal,
focused additions and adjustments to it to suit the needs of Carbon.

Co-authored-by: Thomas Köppe <tkoeppe@google.com>
Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: austern <austern@google.com>
Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2020-11-13 00:49:54 -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
Jon Meow 8e3b67513a Fix decision filename (#186) 2020-10-30 11:06:13 -07:00
Sidney HummertandChandler Carruth 1721701bc6 Create decision for proposal 149--Change markdown style guide (#165)
* Create p0149_decision.md

Create decision for proposal 149--Change markdown style guide

* Update proposals/p0149_decision.md

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>

* Update proposals/p0149_decision.md

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>

* Run pre-commit

* Update README.md

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2020-10-30 10:34:21 -07:00
Richard Smith c197215bca Proposal: Unicode source files (#142)
Factored out of the Lexical Conventions proposal (https://github.com/carbon-language/carbon-lang/pull/173). This proposal covers only the encoding aspect: Carbon text is Unicode, source files are encoded in UTF-8, and we will follow the Unicode Consortium's recommendations to the extent that they make sense to us.
2020-10-28 17:25:20 -07:00
Chandler CarruthandJon Meow 3bd756c773 Decision for p0143 - Numeric literals (#167)
Adds a decision and rationale for proposal #143.

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2020-10-16 14:54:25 -07:00
Sidney Hummert 4e81e25877 Decision for proposal #42 (Create code review guidelines) (#176)
* Decision for proposal #42 (Create code review guidelines)

This is a recreation of PR #137 that got stuck in git merge hell.

* Results of running pre-commit
2020-10-16 13:38:36 -07:00
Jon Meow e36f9a1546 Change markdown style guide (#149)
-   [RFC topic](https://forums.carbon-lang.dev/t/rfc-change-markdown-style-guide/123)
-   [Decision topic](https://forums.carbon-lang.dev/t/request-for-decision-change-markdown-style-guide/132)
-   [Decision announcement](https://forums.carbon-lang.dev/t/accepted-change-markdown-style-guide/137)
2020-10-14 16:59:46 -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
Richard Smith ccb99ad6f2 Proposal for numeric literal syntax. (#143)
This proposal specifies lexical rules for numeric constants in Carbon.
2020-10-05 19:24:46 -07:00