Commit Graph
496 Commits
Author SHA1 Message Date
Richard SmithandChandler Carruth 7eaad4eba0 Use a proof-of-work return type for Lex* functions (#290)
Use a safer return type for the Lex* functions, that requires us to
provide a Token as proof that we lexed something.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-02-26 17:51:28 -08:00
Richard Smith a8e4a69328 Initial lexing support for real literals following #143. (#273) 2021-02-26 17:34:01 -08:00
Jon Meow a09693b38d Stop pulling the schema, it's optional and hits a github/gql incompatibility (not sure whose bug) (#306)
Should fix #300
2021-02-26 15:05:03 -08:00
Dave Abrahams 4383b9fd92 Doc: make tools needed by tests required/add validation check 2021-02-26 13:15:05 -08:00
Geoff Romer 853360345e Update executable semantics for choice to match final state of p0157 (#304)
* Make parentheses optional for alternatives with no arguments.

* Use `,` instead of `;` as separator for alternatives, and make the trailing separator optional.
2021-02-26 13:12:09 -08:00
Dave Abrahams 29a59944fa Executable Semantics: 1st-class stacks (#296)
Replaces low-level uses of `Cons` with a first-class `Stack` data structure.  Also removes an unused algorithm.
Co-authored-by: Jeremy Siek <jsiek@indiana.edu>

Possible next step: use `std::stack` instead.
2021-02-26 09:46:32 -08:00
Chandler Carruth 21917095a3 Add a parameter to fix a failing python test. (#303)
This fixes a python test failure for me.
2021-02-26 09:18:19 -08:00
Chandler Carruth 39aea3c45d Add Bazel repositories for Flex and Bison. (#279)
This makes executable semantics build and pass tests for me without
installing either Bison or Flex. We just use the primitive toolchain
with the existing genrule as the packaged rules don't quite fit how
we're building and organizing the code.

Currently, this points at forks of the upstream rule repositories while
PRs I have sent there are going through, but this should be functional
for now and there doesn't seem to be any reason to wait for those PRs to
go through.
2021-02-25 19:03:38 -08:00
Chandler CarruthandMatthew Riley 13303159f5 Download prebuilt Clang instead of building locally (#299)
Tested on Ubuntu 20.04 and macOS (both Intel and M1 BigSur).

The bootstrap option is still available with `--config=force_local_bootstrap`.

Note that while this works on the ARM M1 for macOS, it is using the x86-based
toolchain and Rosetta, not doing an ARM build at the moment.

You can also point at a locally installed Clang and LLVM toolchain by using
the `--override_repository` flag to Bazel.

Co-authored-by: Matthew Riley <mdriley@gmail.com>
2021-02-25 18:36:41 -08:00
Richard Smith bbaa0e788c Update comment lexing to match #198. (#292)
Require a space after a `//`, and recognize but reject a `//` that follows non-whitespace text in the same line. Remove DocComment token kind that ended up not being part of the design.
2021-02-25 16:16:08 -08:00
Jeremy G. Siek 3ea84c9276 adding optional else to executable semantics (#295)
* adding comments and some newlines

* added optonal else
2021-02-25 18:07:50 -05:00
Jeremy G. SiekandJon Meow a93ec369cb adding comments and some newlines (#294)
* adding comments and some newlines

* Update executable_semantics/interpreter/typecheck.cpp

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

* Update executable_semantics/interpreter/typecheck.cpp

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

* Update executable_semantics/interpreter/typecheck.cpp

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

* Update executable_semantics/interpreter/typecheck.cpp

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

* Update executable_semantics/interpreter/typecheck.cpp

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

* changed comment style

* Update executable_semantics/interpreter/typecheck.cpp

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

* Update executable_semantics/interpreter/typecheck.cpp

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

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2021-02-25 17:57:00 -05:00
Jon Meow 23009d3b06 Stop using 'Review manager requests', adjust some minor advice bits. (#293) 2021-02-25 11:15:13 -08:00
Jon Meow c2f8e382d0 Add links to new proposals (#283) 2021-02-23 15:42:23 -08:00
Jon Meow dbca3fcc36 Increment year in template (#281) 2021-02-23 10:41:24 -08:00
Chandler Carruth b302c50013 Run clang-format over these inputs with the correct style configuration. (#278) 2021-02-22 17:16:27 -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
Richard Smith 7670b6377c Initial lexing support for integer literals following #143. (#269) 2021-02-19 14:01:55 -08:00
Jon Meow d16e042950 Quick fix for master->main branch rename (#268)
Done in https://github.com/bazelbuild/rules_foreign_cc/issues/472, this is probably de facto the new state.
2021-02-12 15:13:48 -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
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
Jon Meow 1fd12add60 pre-commit update (#258)
Revs are from `pre-commit autoupdate --freeze` (jlebar isn't providing versions, thus the sha, but this does silence a warning from pre-commit).

The migration to the new prettier location is manual, but noted at https://github.com/prettier/pre-commit

Manually validated with pre-commit run --all-files
2021-02-04 12:52:34 -08:00
Jon Meow e3f922b977 Consolidate ownership for easier reviews (#256)
Add implementation-team to more dirs, drop infra-team
2021-02-04 10:48:33 -08:00
Jon Meow 0db39f0f00 Add toc to code of conduct (#245)
Tiny change
2021-02-04 10:39:02 -08:00
Jon Meow 440352af7d Add a link to contributing from README, with ToC for visibility. (#250) 2021-02-04 10:30:06 -08:00
Jon Meow 65914f955e Add a .vscode exception. (#248)
We'd tried to skip this before, but VSCode keeps wanting to create the directory for me, and I think both you and I are using it (maybe me more than you right now?). I'd like to just ignore it -- seems like a cheap add.
2021-02-04 10:29:50 -08:00
Jon Meow 0281274d9c toolchain-team -> implementation-team (#249) 2021-02-03 16:28:19 -08:00
Sidney Hummert bc456bb430 Decision for #157: Design direction for sum types (#252)
* Decision for #157: Design direction for sum types

* Update p0157_decision.md

* Update p0157_decision.md
2021-02-03 14:36:59 -08:00
Sidney HummertandJon Meow 8c6472c879 Decision for #196: Language-level safety strategy (#251)
* Decision for #196: Language-level safety strategy

* Update p0196_decision.md

Added the request to update the build mode wording.

* Update proposals/p0196_decision.md

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

Co-authored-by: Jon Meow <46229924+jonmeow@users.noreply.github.com>
2021-02-03 14:36:47 -08:00
Jon Meow 48179cc888 Update contributing doc (#244)
Just a minor refresh, and trying to make the contribution tools link a bit more general (I'll be updating that separately, but it's already more generic than indicated).
2021-02-02 11:48:02 -08:00
Jon MeowandChandler Carruth b2350ef8ec Add -L linker flag to work around gcc path issue. (#243)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2021-01-29 14:51:46 -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
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
Chandler Carruth 9da9c62225 Port Bazel toolchain and code to macOS (x86). (#238)
This updates the Bazel toolchain logic to work on macOS. Much like on
Linux, I'm not testing this against a *released* LLVM, but against
a from-source build. You can build and install LLVM from top-of-tree
locally with CMake, or on macOS maybe use Homebrew like:
```
brew install llvm --HEAD
```

You then need to point Bazel to the installed `clang` executable if it
is not placed onto your PATH (Homebrew doesn't):
```
bazel test --repo_env=CC=$HOME/homebrew/opt/llvm/bin/clang //parser:all
```

This builds and passes tests for me at least.

The fuzzer feature may not work (yet) with this setup, but that can be
improved incrementally as we proceed.
2021-01-16 16:08:51 -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
Jon Meow 9a04cd8d61 Enable clang-format and buildifier presubmits (#236) 2021-01-13 09:41:53 -08:00
Sidney Hummert f42da8f3e5 Decision for #179: Create a Toolchain Team (#225) 2020-12-30 08:13:48 -08:00
Jon Meow ef6505a624 Get rid of the website symlink forest (#234) 2020-12-29 17:34:08 -08:00
Chandler Carruth b3ece12b74 Update LLVM submodules. (#231) 2020-12-29 15:29:16 -08:00
Jon Meow 1e8930e21b Bazelify the jekyll handling. (#230)
- Shift some things around to adjust to being in bazel.
- Add separate build/serve/publish scripts for use by bazel (not set up for direct execution, but bazel requires +x).
- Fix some tests I noticed not running unittest.main as a result of the switch.
- Move md files into filegroups for build reuse.
- Disable automatic site publishing (now `bazel run //website/jekyll:publish`)

Site publishing seems like it'd be too much trouble to keep automated... The C++ toolchain essentially needs to be set up due to the repo config, along with syncing the LLVM submodules, etc. That seems a bit annoying to do on each run of the publish-docs action, and not something I really want to maintain. If we get a CI, we can focus on it more there, but this feels like it'd just be a one-off to maintain as a github workflow.
2020-12-29 15:15:24 -08:00
Jon Meow d76f8a1eff Bazel-ify most of the Python scripts. (#229) 2020-12-28 16:37:55 -08:00