Commit Graph
1157 Commits
Author SHA1 Message Date
3405691582 7147ea0144 Make platform-specific mmap flags the exception. (#1929)
MAP_POPULATE is a Linux mmap flag that optionally assists read-ahead on
the mapping. It is nonstandard and omission does not affect the
underlying mapping, so fall back to not including the flag, rather than
the reverse.
2022-08-08 16:38:02 -07:00
Jon Ross-Perkins 21d39ef4f9 Add 'about' to group links so the description shows (#1958) 2022-08-08 12:10:37 -07:00
cabmeurer 8f80399bad Fix typo: Add missing backtick (#1959)
There was a small typo in the `contribution_tools.md` for `bazel test //...:all`
2022-08-08 10:42:22 -07:00
Jon Ross-Perkins d7613f5ef7 Updating links for shared drive and access notes (#1933)
Part of #1902 

Fixes #1904 

Regarding #1904, using #access-requests because I've decided I feel weird using any other channel for this (including #proposal-prs-and-process)
2022-08-08 09:11:00 -07:00
Chandler Carruth a4a3cf0136 Create a sync-repos action. (#1863)
This will allow us to automatically create and maintain specific repos
based on the main repository here, pulling key files like the license
and other infrastructure and pushing them systematically to a narrow
repo. Things like editor plugins that are best packaged and installed
from a separate repos can still be developed in a central place, even
potentially sharing common things like grammars where useful.

Currently this will maintain a Vim plugin repository out of the
`utils/vim` directory, but can be easily expanded for other systems.
2022-08-06 15:42:41 -07:00
Jon Ross-Perkins b9e6f82f5d Remove project flag (#1939)
Contributors can't do this right now (requires repo write permissions), need to investigate as part of #1898 (projects v1 vs v2 results may differ)
2022-08-06 14:22:37 -07:00
Metarsit 76a262c0e9 Format Bazel files and add argument to run buildifier on pre-commit (#1919) 2022-08-05 10:09:13 -07:00
Krishna Agarwal 674f2257db grammar mistakes (#1915)
Grammar Mistakes
2022-08-05 08:33:24 -07:00
db3caa5b0c A pass at documenting the toolchain implementation (#1897)
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2022-08-05 08:26:20 -07:00
Jon Ross-Perkins fb38a43de8 Add formatter mention to the goals (#1922)
Trying to do this without affecting too much. I think we've generally considered this to be part of "refactoring tools", since large-scale refactoring is assisted by automatic formatting, but formatting is visible enough that it's probably worth addressing directly.

Fixes https://github.com/carbon-language/carbon-lang/issues/1656
2022-08-05 07:51:27 -07:00
pmqtt 6dd46066a0 Bool->bool (#1920)
Change Bool to bool in Prelude
2022-08-04 11:09:24 -07:00
pmqtt 63da070671 add operator to comparsion (#1883)
Implement operator <, <=, > and >=
2022-08-04 09:56:16 -07:00
Richard Smith 8af9ebda88 Remove mention of i256 and u256 (#1911)
For now, only document up to 128-bit support given that's all that LLVM supports, in particular for division.
2022-08-04 09:44:16 -07:00
Richard Smith e26bc32343 Change remaining uses of Bool to bool, following #750. (#1901)
The most significant change here is that explorer now uses the chosen spelling
rather than the old `Bool` spelling. Also update a few documentation examples
and some skeletal design docs to use the chosen spelling.
2022-08-03 17:55:34 -07:00
3405691582 72d3d3c75c Don't assume llvm-ar and clang are adjacent. (#1879)
The toolchain embeds the assumption that `clang` and `llvm-ar` are
adjacent, which may not be true on all host platforms. Moreover,
in #1842 and #1843, we test if Homebrow LLVM is in `PATH` by checking
that `llvm-ar` is adjacent to `clang` and if it isn't, we `fail()` the
build, even if `llvm-ar` *is* in `PATH`.

Instead, actually check `PATH` with `repository_ctx.which`. This however
necessitates the assumption that `llvm-ar` and other LLVM binutils
are adjacent, and subsequently that `clang` and `ld.lld` are adjacent.

It appears that we don't seem to always be using these tools, but we
should avoid embedding wrong assumptions regardless.

Update docs to reflect this change.
2022-08-03 15:40:25 -07:00
Zenong Zhang 2f4905bf70 Implement static analysis of unformed usage on local variables. (#1831)
- An introprocedural forward analysis that checks the may-be-formed states on local variables.
 - Returns compilation error on usage of must-be-unformed variables. 
 - Implemented as a pass of `ASTNode` traversal. 
 - Currently supports detection of: function parameter, return expression and rhs of assign.
2022-08-03 15:28:51 -07:00
Adrien Leravat 094311133d Add parsing (only) support for class prefix and 'extends' (#1880)
Provides a first implementation iteration towards class prefix and extension, along with user-friendly error regarding missing implementation for #1881 

**Explorer behavior**
For class prefix `base` and `abstract`: 
```
Class prefixes `base` and `abstract` are not supported yet
```
For extension with `extends`: 
```
Class extension with `extends` is not supported yet
```

**Motivation**
* Provides user-friendly error for these unsupported features
* First implementation increment in supporting class prefix and extension.
2022-08-03 15:24:28 -07:00
Geoff Romer 37f7702d32 Broaden prohibition on insults (#1890)
We shouldn't allow insults even when they're directed against people who aren't "participants", or when they're directed against ideas (because that indirectly attacks the people holding those ideas).
2022-08-03 17:17:02 -04:00
Zenong Zhang 9a7914ee3a Disabled autoupdate (#1894)
Auto-update tries to add `CHECK: Nice!` or `CHECK: HALLO WELT` to the test case. As what's being printed is non-deterministic, the auto-update should be disabled.
2022-08-03 13:19:05 -07:00
Zenong Zhang 8cf32ae107 Implement unformed state of returned var. (#1870)
Added parsing and test casts for unformed `returned var`.
2022-08-03 12:29:15 -07:00
Krishna AgarwalandGeoff Romer 09e62752a0 fixes in docs (#1851)
Co-authored-by: Geoff Romer <gromer@google.com>
2022-08-03 11:33:13 -07:00
Shakeel MahateandJon Ross-Perkins 79df59b1dd Incomplete sentence in _let bindings_ (#1697)
The original sentence was grammatically unsound, specified the three options of copy, move or pointer binding in parenthesis and some words around it.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-08-02 10:12:29 -07:00
Jon Ross-Perkins 61fd0a1476 Rollback ubuntu disable (#1877)
Fixed upstream just as I was getting #1872 in
2022-08-01 18:25:13 -07:00
Jon Ross-Perkins 2ed6b6fe8f Temp disable ubuntu testing (#1872)
See #1865, it's broken and I don't see a quick fix.
2022-08-01 18:12:44 -07:00
josh11b 6210353dfe Update links to open discussion minutes archives (#1873) 2022-08-01 16:46:19 -07:00
MarchMore 8b5c13e8de Update CODE_OF_CONDUCT.md (#1810)
Ground rules bullet points do not match with the following detailed description captions
2022-08-01 16:07:59 -07:00
Jon Ross-Perkins eac7aecd86 Remove 'no room' idiom (#1852)
Per discussion, this is confusing some people who read it as "don't allow" rather than "no need". I think "no need" is the original intent.
2022-08-01 11:23:10 -07:00
Jon Ross-Perkins 92748e6b35 Update pre-commit version for underscores in symlinks (#1845) 2022-08-01 11:08:05 -07:00
Richard SmithandJon Ross-Perkins ef96f60425 Add support for bitwise operators. (#1809)
Following #1191, add initial support for bitwise operators. Support for both
integer operations and for operator overloading via the interfaces specified in
#1191 is provided.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-31 15:25:10 -07:00
x2wandJon Ross-Perkins 52f80c25ab Add syntax highlighting for vim and neovim (#1740)
PR to add a vim syntax file to support syntax highlighting for .carbon files. Since the Carbon language specification is still in progress, a single syntax file is easier to maintain and adapt to design changes in Carbon. After the language syntax has matured and stabilized, advanced tooling such as Treesitter and Language Servers can take over the syntax highlighting in neovim.

### Highlighting Support
- comments and preprocessors (RUN, CHECK, etc)
- string and numeric literals
- primitive type names, classes, aliases
- control flow constructs
- identifier names
- package and library declarations
- most keywords mentioned in `docs/design/README.md`

### With a Dark Colorscheme:
![carbon01](https://user-images.githubusercontent.com/78875280/181017032-e2c140c8-e98a-46d3-8f94-b8dc0f28ce49.png)

This image is longer than I thought, so I'm not posting what it looks like in a light colorscheme, but it should look fine as long as vim highlight-groups are properly defined.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-31 08:32:00 -07:00
Matt Armstrong fce3618cc2 Try to make some FAQ questions more inviting (#1848)
Replace the "why we don't want to discuss things" question with three
questions covering substantially the same topic. Try to strike a balance
between inviting participation and feedback while still making it clear
that the evolution process produces "firm" decisions.

Address issue #1833.
2022-07-30 19:03:27 -07:00
jkamins7andJon Ross-Perkins c13803de99 Fix for CC being sometimes a path and sometimes a file on PATH (#1724)
Possible fix for #1713

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-30 13:48:38 -07:00
13d6c33830 Fixed some grammar errors (#1599)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
Co-authored-by: Divanshu Chauhan <23524935+Divkix@users.noreply.github.com>
2022-07-30 12:12:03 -07:00
Thejaswi Kadur 5665f32bf7 Support for user-defined Eq impls (#1730)
Related to #1549; user-defined equality is a prerequisite for user-defined comparison.
2022-07-30 11:51:39 -07:00
Calvin b988d5353c Add check for LLVM tools in build config script (#1843)
By adding a small, proactive safety check, the hope is that this will better point developers in the direction of a fix and reduce the volume of duplicate issues filed for this common troubleshooting question.

This change seems to be safe in the present as this check mirrors the current behavior in `clang_cc_toolchain_config.bzl`, finding these tools in the same directory beside `clang`. Non-standard builds using the same bazel toolchain config should not be affected for this reason. If that behavior ever changes in the future, this check will become out of sync.

Open to ideas for better heuristics here! However, checking for `llvm-ar` seems to satisfactory for right now. Verified this change worked locally (macOS) with and without Homebrew's LLVM in `PATH`.

Might want to wait on review from @chandlerc.

Fixes #1842.
2022-07-30 11:23:38 -07:00
MarchMore a3dc3cac74 Documentation: Minor corrections of several md files (#1806) 2022-07-30 11:16:11 -07:00
Vitalii 4872f49ce7 Rework of .devcontainer (#1816) (#1817)
> The only issue that I currently have with this one is that the `clangd` extension is having some hiccups, not being able to find includes like `<gmock/gmock.h>` and `<benchmark/benchmark.h>` and thus showing extra errors. However, this only affects the VSCode extension and bazel seems to work fine.

This might be an issue with the compilation database: you might try ./scripts/create_compdb.py to help.
2022-07-30 10:54:45 -07:00
Vaishnavi JoshiandJon Ross-Perkins a60e78485a fixed broken link in faq section (#1825)
The link now redirects to main readme of the project as expected.

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-30 08:30:45 -07:00
Matt Armstrong 2fa74f1d71 Add a new "How can I contribute?" top level heading to the FAQ (#1827)
This provides a natural place for questions about the specifics of how to
contribute effectively, which, near term, is probably where the FAQ will
grow the most near term. This allows the other headings to remain more
focused on their original questions.

Move two existing questions to the new place without changing their
content: "What are the prerequisites for contributing [...]?"  and "Why
aren't people willing to discuss certain topics [...]?".
2022-07-29 17:21:31 -07:00
Adrien Leravat cbd4b8d82d Add explorer support for short-circuit evaluation for 'and' and 'or' (#1789)
Implements short-circuit evaluation for `and` and `or` binary
operators.

Fixes #1651
2022-07-29 13:10:40 -07:00
Zenong Zhang 13f97e09e8 Added back error message on action stack. (#1826) 2022-07-29 13:07:00 -07:00
Krishna Agarwal 4d53e3ffe3 grammar error (#1795) 2022-07-29 11:02:52 -07:00
pmqttandm new df93623741 Extends carbon to generate random number to make samples more interesting (#1643)
Implements the Rand function to carbon

Co-authored-by: m new <michael.burzan@outlook.de>
2022-07-29 10:39:30 -07:00
SADIK KUZU df2ec7ab22 Update pre-commit config (#1773)
Update pre-commit config yaml file

* Updating https://github.com/pre-commit/pre-commit-hooks ... updating db7346d375eda68a0174f2c057dd97f2fbffe030 -> v4.3.0 (frozen).
* Updating https://github.com/google/pre-commit-tool-hooks ... already up to date.
* Updating https://github.com/psf/black ... updating ae2c0758c9e61a385df9700dc9c231bf54887041 -> 22.6.0 (frozen).
* Updating https://github.com/pre-commit/mirrors-prettier ... updating 5e374fda194d7f7ce9eebbd582b2a5594838c85b -> v2.7.1 (frozen).
* Updating https://github.com/PyCQA/flake8 ... already up to date.
* Updating https://github.com/pre-commit/mirrors-mypy ... updating a04404bdf52c2cbc9c5bd705454b89bd83b84383 -> v0.971 (frozen).
* Updating https://github.com/codespell-project/codespell ... already up to date.
* Updating https://github.com/google/pre-commit-tool-hooks ... already up to date.
2022-07-29 07:53:34 -07:00
1b2047d075 Added the ZLib development package as a Linux requirement to the Main Tools section (#1558)
Fixes #1527

On Debian, the zlib1g-dev package is required to build and should be given as a requirement.

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2022-07-28 23:05:30 -07:00
yale 85cb70c0a3 Add DevContainer (#1608)
With DevContainer, developers can join the project without deploy the build env.

Signed-off-by: cyw3 <2927096163@qq.com>
2022-07-28 16:03:48 -07:00
7be95ccb19 Operator overloading modulo (#1808)
Co-authored-by: m new <michael.burzan@outlook.de>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-07-28 17:45:07 -04:00
9f89c63503 Add operator modulo (#1681)
Co-authored-by: m new <michael.burzan@outlook.de>
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2022-07-28 12:51:35 -07:00
Mats Larsen 8ba4916ab4 Implement minimal textmate language definition (#1595)
TextMate is the go-to definition language for syntax highlighting for editors lack dedicated language support for a given programming language. This patch contains a very minimal, yet functional TextMate bundle definition for Carbon.

This allows Carbon users to import the TextMate bundle into their editors to get basic syntax highlighting for Carbon code until we have a more solid specification for the language (that's when the fun with dedicated plugins/extensions begins!).

**Support**
- String literals with escape codes (currently using C highlighting rules)
- Numeric literals in decimal, hexadecimal and binary (lacks _ separator support though)
- Single and multi-line comments
- Highlighting of all? (let me know if some are missing) keywords in the language

Here is an image of the highlighting in action in IntelliJ Dracula mode
![image](https://user-images.githubusercontent.com/42585241/180587912-23b5ae3e-2bdb-49a1-83e8-24e6e0b7cfb5.png)
2022-07-28 11:32:41 -07:00
purpl3r0se f050a08c45 Update README.md (#1803)
I atleast believe this is a typo, may not be tho.
2022-07-28 10:22:21 -07:00