Commit Graph
377 Commits
Author SHA1 Message Date
Jon Ross-Perkins 59f91aa0d5 Replace README folders with proper public version (#1430) 2022-07-19 14:50:35 -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
Matt Godbolt eeb91cb044 Update FAQ to point at compiler explorer instance. (#1429) 2022-07-19 16:14:11 -04:00
Laurent Le Brun d87d58aa52 Spec: Fix link to the Explorer tool (#1420) 2022-07-19 13:50:47 -04:00
Laurent Le Brun 9a370994b5 FAQ: Update link to the Discord server (#1419) 2022-07-19 13:30:01 -04:00
Jon Ross-Perkins 31c3953a5f Orient README around Print (#1409) 2022-07-19 06:17:46 -04:00
c867b38334 Create a FAQ for Carbon (#1385)
Trying to collect together answers for various project questions we've received in previews.

@gribozavr @danakj and @hlopko contributed most of the Rust FAQ entry.

Co-authored-by: Dmitri Gribenko <dmitrig@google.com>
Co-authored-by: Dana Jansens <danakj@google.com>
Co-authored-by: Marcel Hlopko <hlopko@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-07-18 11:08:17 -04:00
8dd878b314 Remove CODEOWNERS (#1367)
Remove CODEOWNERS and rely on repository commit access

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Geoff Romer <gromer@google.com>
2022-07-15 15:31:56 -07:00
53053e5959 Design overview update part 7: values (#1378)
This follows #1274 , #1325 , #1328 , #1336 , #1347 , and #1368 . This fills in details about how values work, value categories, parameter passing, unformed state, and so on.

Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-07-15 14:42:39 -07: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 eed666f0d4 Fix interface extends syntax (#1383) 2022-07-12 10:14:32 -07:00
josh11b 16f9d82541 Fix binding syntax to be id: Type (#1381) 2022-07-12 10:14:11 -07:00
josh11bandJon Ross-Perkins 77df7c56d9 Design overview update part 6 (#1368)
This follows #1274 , #1325 , #1328 , #1336 , and #1347 . This has miscellaneous changes to the design overview without a particular focus.

Also adds some missing keywords to our list of keywords.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-07 22:05:41 -07:00
5535f5ee30 Design overview update part 5: Names (#1347)
This follows #1274 , #1325 , #1328 , and #1336 . It fills in the "Names" section.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-07-06 16:57:25 -07:00
4aa462c2ac Make the Carbon experiment public. (#1363)
This is a proposal to make the Carbon experiment public.

We have not yet hit many of the originally suggested criteria for going
public. However, this proposal suggests that increasingly there is more
value to moving public sooner rather than waiting to hit these criteria.
We are increasingly unable to substantially learn more about the broader
interest in Carbon without it being public and we increasingly see value
in working with the industry to build and shape the language.

Given this, the proposal removes the old plan-of-record and suggests
a concrete set of steps to make the experiment public in the immediate
future.

This is not a change that we can make lightly to the project, and so we
worked to check with as many folks as we could first and all three
leads were unanimous to move forward here.

Note that this proposal was originally discussed in PR #1315.

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-07-01 18:11:40 -07:00
df345b5ec7 Remove LLVM from the repo, and clean up history. (#1344)
This proposal establishes a plan for moving away from the embedded copy
of LLVM and instead downloading it with Bazel.

The goal is that after this lands, we will do a history-rewrite to
cleanup the repository. There are instructions on how folks can move any
in-flight work over to the newly tidied repo.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2022-06-28 13:49:38 -07:00
fbf353afe8 Design overview update part 4: C and C++ Interop (#1336)
This follows #1274 , #1325 , and #1328 . It fills in the "Bidirectional interoperability with C and C++" section.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Geoff Romer <gromer@google.com>
2022-06-27 17:20:24 -07:00
josh11b b83f5c3fc7 Generics: impl forall (#1327)
Implement the decision in #1192 to use this syntax for parameterized impls:

> `impl forall [`_generic parameters_`]` _type_ `as` _constraint_ ...
2022-06-14 19:35:53 -07:00
josh11bandChandler Carruth d37dfd2fb8 Design overview update part 3: Safety (#1328)
This follows #1274 and #1325 and fills in the "safety" section. It only covers our approach in general terms.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-06-14 13:22:22 -07:00
bc40bdc279 Principle: All APIs are library APIs (#1280)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-06-13 13:10:43 -07:00
josh11bandChandler Carruth 504a4b1364 Design overview update part 2 (#1325)
This follows #1274 . It mainly fills in the "generics" section, with smaller updates to other section.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-06-12 15:36:29 -07:00
Geoff Romer 6ab9c487be Restructure goals doc to reduce nesting. (#1319)
Prior to this change, the section headings for the 7 main goals are visually indistinguishable (in GitHub's rendering) from the boldfaced paragraph headings in those sections. This makes the doc hard to navigate because the structure is hidden.
2022-06-10 21:17:43 -07:00
b17e69aefd Design overview update part 1 (#1274)
Reorganizes the sections, and makes a pass filling in and updating the first sections including: types, functions, user-defined types. The following sections are left for part 2, including names, generics, and interop.

Also some smaller updates to, not revisiting the text: `pattern_matching.md`, `control_flow/return.md`, and `lexical_conventions/numeric_literals.md`

Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-06-09 12:58:22 -07:00
Jonathan Ross-Perkins a97276bcf7 TODO -> FIXME (#1316)
This is for https://google.github.io/styleguide/cppguide.html#TODO_Comments; FIXME seems to be getting used for the same purpose, and we should probably only have one so that it's easier to scan for.
2022-06-07 10:49:17 -07:00
Jon Meow 8a515937fc Fix #include <vector> in code image (remove quotes) (#1314)
The text is correct.
2022-06-06 17:47:30 -07:00
b62b7464a4 Update and expand README content and motivation for Carbon (#1270)
Some review feedback from outside the team directly working on Carbon suggested
two pretty significant updates here. First, we didn't do a good job of
motivating Carbon. This takes two parts, first explaining what we'd like to
accomplish with this approach generally, and second explaining why alternative
approaches don't work. A particularly difficult case here is articulating
effectively the difficulties that motivate an approach other than improving C++
incrementally.

Co-authored-by: Jon Meow <jperkins@google.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2022-06-06 17:16:27 -07:00
josh11b eab34bee6b Link to Rust blog post about implied bounds (#1275) 2022-05-17 18:26:16 -07:00
josh11b fb0e8fa3bd Fix extra } in sample code (#1269) 2022-05-16 17:04:31 -07:00
Richard Smith d2b33a712f Fix missing backtick (#1235) 2022-05-06 20:56:16 -07:00
Richard SmithandChandler Carruth c4fecf720f Bitwise operators (#1191)
Add bitwise and bit-shift operators `&`, `|`, `^`, `<<`, `>>`. Replace C++ `~` with unary prefix `^`.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-05-06 14:26:55 -07:00
josh11bandRichard Smith 125224ab08 Generic details 10: interface-implemented requirements (#1088)
This proposal:

- Adds support for interfaces requiring other types than `Self` to implement interfaces, as in:
  ```
  interface IntLike {
    impl i32 as As(Self);
    // ...
  }
  ```
- Defines requirements on how to satisfy those requirements that have a `where` clause.
- Extends `observe` declarations to include saying a type implements an interface, so code can provide a proof instead of the compiler having to perform a recursive search.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-05-05 15:30:40 -07:00
Jon MeowandGeoff Romer cc9bebb1d0 Minor carbon-explorer edit to roadmap (#1225)
A rephrasing was suggested on https://github.com/carbon-language/carbon-lang/pull/1188#discussion_r851416370 because "explorer" alone could be hard to parse; I'm suggesting just replacing with "Carbon explorer" to get precision without changing phrasing, as well as rephrasing "Executable semantic" as "Carbon explorer" (which... the former *may* have meant "executable semantics", but the difference in pluralization made it vague, so I'm not sure this is right -- but it also didn't explain _where_, so "executable semantics" seems the right reading)

Co-authored-by: Geoff Romer <gromer@google.com>
2022-05-04 16:12:26 -07:00
e18675608b Reviewer-merged PRs (#1190)
Encourage reviewers to merge when they feel okay doing so. Let reviewers make
that choice. Let authors say they'll merge themselves.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-05-04 13:12:18 -07:00
Richard SmithandChandler Carruth 4a8ca9cd0f Rework operator interfaces (#1178)
Add concrete design for interfaces for comparison.

Rename interfaces for arithmetic following current thinking in #1058.

Update rules for mixed-type comparisons for data classes following #710.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-05-03 15:37:45 -07:00
Jon MeowandChandler Carruth f42ca044cb Rephrase arguments around data versus emotional. (#1212)
Right now, the text is disallowing appeals to logic (which are persuasive methods, per the linked wikipedia article). Consensus seems to be that this is unintentional.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-05-02 08:25:26 -07:00
Jon Meow 309ec35f95 Rename executable_semantics to explorer (#1188)
Change generated with:

```
#!/usr/bin/bash -eux

# Helper script for renaming pending work.
# Run from the repo root.

# Rename executable_semantics in code.
sed -i 's/executable_semantics/explorer/g' \
  $(git grep -l 'executable_semantics' . | grep -v proposals)
sed -i 's/executable semantics/explorer/g' \
  $(git grep -l 'executable semantics' . | grep -v proposals)
sed -i 's/Executable semantics/Explorer/g' \
  $(git grep -l 'Executable semantics' . |  grep -v proposals)
sed -i 's/Executable Semantics/Explorer/g' \
  $(git grep -l 'Executable Semantics' . |  grep -v proposals)
sed -i 's/EXECUTABLE_SEMANTICS/EXPLORER/g' \
  $(git grep -l 'EXECUTABLE_SEMANTICS' . | grep -v proposals)
sed -i 's/ExecutableSemantics/Explorer/g' \
  $(git grep -l 'ExecutableSemantics' . | grep -v proposals)
sed -i 's/executable-semantics/explorer/g' \
  $(git grep -l 'executable-semantics' . | grep -v proposals)

# This is only needed for the initial move.
mv executable_semantics explorer
mv explorer/fuzzing/executable_semantics_fuzzer.cpp explorer/fuzzing/explorer_fuzzer.cpp
```

Verified with `bazel test ...`
2022-04-29 13:20:25 -07:00
josh11bandRichard Smith b9538129a2 Generic details 12: parameterized types (#1146)
This proposal has three main contributions:
- Types with generic parameters have an identity that consists of the types names plus the values of those parameters.
- The parameters of a type may be deduced from a function's argument.
- Types with generic parameters do not support specialization. Instead, a type can delegate to an interface to opt in to allowing specific customization points.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-04-28 16:16:00 -07:00
62c8821f20 Rewrite example for span/Slice. (#1203)
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-04-27 12:43:55 -07:00
josh11bandRichard Smith d7a90609cc Update docs/ READMEs (#1211)
With a focus on making each README a good representation for its directory, and adding links.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-04-27 12:07:53 -07:00
josh11b 9b028bb743 Destructors (#1154)
Add a way for classes to add custom destructor code:
```
class Class1 {
  // forward declaration
  destructor [me: Self] { ... }
}
// out-of-line definition
destructor Class1 [me: Self] { ... }

class Class2 {
  // can modify `me` as part of destruction
  destructor [addr me: Self*] { ... }
}
base class MyBaseClass {
  virtual destructor [addr me: Self*] { ... }
}
class MyDerivedClass extend MyBaseClass {
  impl destructor [addr me: Self*] { ... }
}
```
and constraints `Concrete`, `Deletable`, `Destructible`, and `TrivialDestructor`.
2022-04-18 17:39:33 -07:00
Jon MeowandRichard Smith 9c0675d2b4 Work on wording around interop tradeoffs (#1185)
Given repeated concerns about C++ interop priorities: taking a pass at being more direct about priorities and tradeoffs.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-04-18 14:37:32 -07:00
06174c51f4 Generics details 9: forward declarations (#1084)
Allow interfaces and implementations to be forward declared.

```
// Forward declare interface `F`
interface F;
class C {
  // Forward declare `C` implements `F`
  impl as F;
}
// Definitions corresponding to forward declarations
interface F { ... }
impl C as F { ... }
```

To allow members of interfaces with default definitions to be forward declared, prefix them with the keyword `default`, following #1082.

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-04-13 12:53:16 -07:00
db66a4350e Generic details 11: operator overloading (#1144)
Operators rewrite to calls of specific operator interface functions, so you overload an operator for a type by implementing an interface for it. There is a `like` operator for defining a set if implementations for supporting implicit conversions more conveniently.

Co-authored-by: Geoff Romer <gromer@google.com>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-04-08 14:51:49 -07:00
Jon MeowandChandler Carruth 8c9bf973c0 Editing README examples (#1164)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-04-08 08:36:12 -07:00
Richard Smith 0b8a96af6d Fix C++ range-based for syntax (#1163) 2022-03-30 18:18:09 -07:00
770279e02d Arithmetic expressions (#1083)
Add support for arithmetic operators:

- Unary `+`.
- Binary `+`, `-`, `*`, `/`, `%`.

Specify their behavior for integer and floating-point types. Signed integer overflow is a programming error, handled in various ways. Unsigned integer overflow is specified as wrapping around, intended for hashing / crypto / PRNG use cases.

Co-authored-by: jonmeow <46229924+jonmeow@users.noreply.github.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2022-03-24 17:51:17 -07:00
josh11b 5238a8d37a Work around prettier bug (#1150)
Looks like this might be related to prettier/prettier#6112 , but the observed behavior is more broken than that bug indicates.
2022-03-23 13:49:48 -07:00
josh11b 3a18ab70f2 Terminology: qualified member access expression (#1142) 2022-03-17 14:08:24 -07:00
31fa2608d4 Updated README.md (#1075)
Revised landing page, including updated README.

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Meow <jperkins@google.com>
2022-03-16 17:33:45 -07:00
Richard Smith 48d5b18026 Initial rough framework for specification. (#140)
Provide an initial rough structure for the specification so we can add things
as they are decided.

Split the specification into a language and a library section. In the language
section, use one file per broad area of functionality. Divide the language up
based on the intended layering of the language design.
2022-03-16 15:43:09 -07:00