1
- # The Rust Programming Language
1
+ < img src = " https://user-images.githubusercontent.com/8974888/231858967-7c37bf1e-335b-4f5a-9760-da97be9f54bb.png " width = " 200 " />
2
2
3
- [ ![ Rust Community ] ( https://img.shields.io/badge/Rust_Community%20-Join_us-brightgreen?style=plastic&logo=rust )] ( https://www.rust-lang.org/community )
3
+ # The Crab Programming Language
4
4
5
- This is the main source code repository for [ Rust] . It contains the compiler,
5
+ [ ![ CrabLang Community] ( https://img.shields.io/badge/CrabLang_Community%20-Join_us-brightgreen?style=plastic&logo=discord )] ( https://community.crablang.org )
6
+
7
+ This is the main source code repository for [ Crab] ( https://github.com/crablang/crab ) . It contains the compiler,
6
8
standard library, and documentation.
7
9
8
- [ Rust ] : https://www.rust-lang .org/
10
+ [ CrabLang ] : https://www.crablang .org/
9
11
10
12
** Note: this README is for _ users_ rather than _ contributors_ .**
11
13
If you wish to _ contribute_ to the compiler, you should read
12
14
[ CONTRIBUTING.md] ( CONTRIBUTING.md ) instead.
13
15
14
16
## Quick Start
15
17
18
+ To get started with the renamed CrabLang toolchain, run the following:
19
+
20
+ ``` sh
21
+ sh <( curl https://install.crablang.org -L)
22
+ ```
23
+
24
+ \* currently Unix only
25
+
26
+ <!--
16
27
Read ["Installation"] from [The Book].
17
28
18
- [ "Installation" ] : https://doc.rust-lang .org/book/ch01-01-installation.html
19
- [ The Book ] : https://doc.rust-lang .org/book/index.html
29
+ ["Installation"]: https://doc.crablang .org/book/ch01-01-installation.html
30
+ [The Book]: https://doc.crablang .org/book/index.html -->
20
31
21
32
## Installing from Source
22
33
23
- The Rust build system uses a Python script called ` x.py ` to build the compiler,
34
+ The Crab build system uses a Python script called ` x.py ` to build the compiler,
24
35
which manages the bootstrapping process. It lives at the root of the project.
25
- It also uses a file named ` config.toml ` to determine various configuration
26
- settings for the build. You can see a full list of options in
27
- ` config.example.toml ` .
28
36
29
37
The ` x.py ` command can be run directly on most Unix systems in the following
30
38
format:
@@ -34,14 +42,25 @@ format:
34
42
```
35
43
36
44
This is how the documentation and examples assume you are running ` x.py ` .
37
- See the [ rustc dev guide] [ rustcguidebuild ] if this does not work on your
38
- platform.
45
+
46
+ Some alternative ways are:
47
+
48
+ ``` sh
49
+ # On a Unix shell if you don't have the necessary `python3` command
50
+ ./x < subcommand> [flags]
51
+
52
+ # On the Windows Command Prompt (if .py files are configured to run Python)
53
+ x.py < subcommand> [flags]
54
+
55
+ # You can also run Python yourself, e.g.:
56
+ python x.py < subcommand> [flags]
57
+ ```
39
58
40
59
More information about ` x.py ` can be found by running it with the ` --help ` flag
41
- or reading the [ rustc dev guide] [ rustcguidebuild ] .
60
+ or reading the [ crabc dev guide] [ crabcguidebuild ] .
42
61
43
- [ gettingstarted ] : https://rustc -dev-guide.rust-lang .org/getting-started.html
44
- [ rustcguidebuild ] : https://rustc -dev-guide.rust-lang .org/building/how-to-build-and-run.html#what-is-xpy
62
+ [ gettingstarted ] : https://crabc -dev-guide.crablang .org/getting-started.html
63
+ [ crabcguidebuild ] : https://crabc -dev-guide.crablang .org/building/how-to-build-and-run.html
45
64
46
65
### Dependencies
47
66
@@ -55,7 +74,7 @@ Make sure you have installed the dependencies:
55
74
* ` pkg-config ` if you are compiling on Linux and targeting Linux
56
75
* ` libiconv ` (already included with glibc on Debian-based distros)
57
76
58
- To build Cargo , you'll also need OpenSSL (` libssl-dev ` or ` openssl-devel ` on
77
+ To build Crabgo , you'll also need OpenSSL (` libssl-dev ` or ` openssl-devel ` on
59
78
most Unix distros).
60
79
61
80
If building LLVM from source, you'll need additional tools:
@@ -71,33 +90,36 @@ If building LLVM from source, you'll need additional tools:
71
90
On tier 1 or tier 2 with host tools platforms, you can also choose to download
72
91
LLVM by setting ` llvm.download-ci-llvm = true ` .
73
92
Otherwise, you'll need LLVM installed and ` llvm-config ` in your path.
74
- See [ the rustc -dev-guide for more info] [ sysllvm ] .
93
+ See [ the crabc -dev-guide for more info] [ sysllvm ] .
75
94
76
- [ sysllvm ] : https://rustc -dev-guide.rust-lang .org/building/new-target.html#using-pre-built-llvm
95
+ [ sysllvm ] : https://crabc -dev-guide.crablang .org/building/new-target.html#using-pre-built-llvm
77
96
78
97
79
98
### Building on a Unix-like system
80
99
81
- #### Build steps
82
-
83
100
1 . Clone the [ source] with ` git ` :
84
101
85
102
``` sh
86
- git clone https://github.com/rust-lang/rust .git
87
- cd rust
103
+ git clone https://github.com/crablang/crab .git
104
+ cd crab
88
105
```
89
106
90
- [ source ] : https://github.com/rust-lang/rust
107
+ [ source ] : https://github.com/crablang/crablang
91
108
92
109
2 . Configure the build settings:
93
110
111
+ The CrabLang build system uses a file named ` config.toml ` in the root of the
112
+ source tree to determine various configuration settings for the build.
113
+ Set up the defaults intended for distros to get started. You can see a full
114
+ list of options in ` config.example.toml ` .
115
+
94
116
``` sh
95
- ./configure
117
+ printf ' profile = "user" \nchangelog-seen = 2 \n ' > config.toml
96
118
```
97
119
98
120
If you plan to use ` x.py install ` to create an installation, it is
99
121
recommended that you set the ` prefix ` value in the ` [install] ` section to a
100
- directory: ` ./configure --set install.prefix=<path> `
122
+ directory.
101
123
102
124
3 . Build and install:
103
125
@@ -106,27 +128,12 @@ See [the rustc-dev-guide for more info][sysllvm].
106
128
```
107
129
108
130
When complete, ` ./x.py install ` will place several programs into
109
- ` $PREFIX/bin ` : ` rustc ` , the Rust compiler, and ` rustdoc ` , the
110
- API-documentation tool. By default, it will also include [ Cargo] , Rust's
111
- package manager. You can disable this behavior by passing
112
- ` --set build.extended=false ` to ` ./configure ` .
113
-
114
- [ Cargo ] : https://github.com/rust-lang/cargo
115
-
116
- #### Configure and Make
117
-
118
- This project provides a configure script and makefile (the latter of which just
119
- invokes ` x.py ` ). ` ./configure ` is the recommended way to programatically
120
- generate a ` config.toml ` . ` make ` is not recommended (we suggest using ` x.py `
121
- directly), but it is supported and we try not to break it unnecessarily.
122
-
123
- ``` sh
124
- ./configure
125
- make && sudo make install
126
- ```
131
+ ` $PREFIX/bin ` : ` crabc ` , the CrabLang compiler, and ` crablangdoc ` , the
132
+ API-documentation tool. If you've set ` profile = "user" ` or
133
+ ` build.extended = true ` , it will also include [ Crabgo] , CrabLang's package
134
+ manager.
127
135
128
- ` configure ` generates a ` config.toml ` which can also be used with normal ` x.py `
129
- invocations.
136
+ [ Crabgo ] : https://github.com/crablang/crabgo
130
137
131
138
### Building on Windows
132
139
@@ -147,23 +154,23 @@ from the Java documentation.
147
154
[ winget ] : https://github.com/microsoft/winget-cli
148
155
149
156
There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
150
- Visual Studio and the GNU ABI used by the GCC toolchain. Which version of Rust
157
+ Visual Studio and the GNU ABI used by the GCC toolchain. Which version of CrabLang
151
158
you need depends largely on what C/C++ libraries you want to interoperate with.
152
- Use the MSVC build of Rust to interop with software produced by Visual Studio
159
+ Use the MSVC build of CrabLang to interop with software produced by Visual Studio
153
160
and the GNU build to interop with GNU software built using the MinGW/MSYS2
154
161
toolchain.
155
162
156
163
#### MinGW
157
164
158
- [ MSYS2] [ msys2 ] can be used to easily build Rust on Windows:
165
+ [ MSYS2] [ msys2 ] can be used to easily build CrabLang on Windows:
159
166
160
167
[ msys2 ] : https://www.msys2.org/
161
168
162
169
1 . Download the latest [ MSYS2 installer] [ msys2 ] and go through the installer.
163
170
164
171
2 . Run ` mingw32_shell.bat ` or ` mingw64_shell.bat ` from the MSYS2 installation
165
172
directory (e.g. ` C:\msys64 ` ), depending on whether you want 32-bit or 64-bit
166
- Rust . (As of the latest version of MSYS2 you have to run `msys2_shell.cmd
173
+ CrabLang . (As of the latest version of MSYS2 you have to run `msys2_shell.cmd
167
174
-mingw32` or ` msys2_shell.cmd -mingw64` from the command line instead.)
168
175
169
176
3 . From this terminal, install the required tools:
@@ -172,7 +179,7 @@ toolchain.
172
179
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
173
180
pacman -Sy pacman-mirrors
174
181
175
- # Install build tools needed for Rust . If you're building a 32-bit compiler,
182
+ # Install build tools needed for CrabLang . If you're building a 32-bit compiler,
176
183
# then replace "x86_64" below with "i686". If you've already got Git, Python,
177
184
# or CMake installed and in PATH you can remove them from this list.
178
185
# Note that it is important that you do **not** use the 'python2', 'cmake',
@@ -188,16 +195,16 @@ toolchain.
188
195
mingw-w64-x86_64-ninja
189
196
```
190
197
191
- 4 . Navigate to Rust 's source code (or clone it), then build it:
198
+ 4 . Navigate to CrabLang 's source code (or clone it), then build it:
192
199
193
200
``` sh
194
- python x.py setup user && python x.py build && python x.py install
201
+ ./ x.py build && ./ x.py install
195
202
```
196
203
197
204
#### MSVC
198
205
199
- MSVC builds of Rust additionally require an installation of Visual Studio 2017
200
- (or later) so ` rustc ` can use its linker. The simplest way is to get
206
+ MSVC builds of CrabLang additionally require an installation of Visual Studio 2017
207
+ (or later) so ` crabc ` can use its linker. The simplest way is to get
201
208
[ Visual Studio] , check the "C++ build tools" and "Windows 10 SDK" workload.
202
209
203
210
[ Visual Studio ] : https://visualstudio.microsoft.com/downloads/
@@ -209,13 +216,12 @@ With these dependencies installed, you can build the compiler in a `cmd.exe`
209
216
shell with:
210
217
211
218
``` sh
212
- python x.py setup user
213
219
python x.py build
214
220
```
215
221
216
- Right now, building Rust only works with some known versions of Visual Studio.
222
+ Right now, building CrabLang only works with some known versions of Visual Studio.
217
223
If you have a more recent version installed and the build system doesn't
218
- understand, you may need to force rustbuild to use an older version.
224
+ understand, you may need to force crablangbuild to use an older version.
219
225
This can be done by manually calling the appropriate vcvars file before running
220
226
the bootstrap.
221
227
@@ -238,8 +244,21 @@ Windows build triples are:
238
244
239
245
The build triple can be specified by either specifying ` --build=<triple> ` when
240
246
invoking ` x.py ` commands, or by creating a ` config.toml ` file (as described in
241
- [ Building on a Unix-like system] ( #building-on-a-unix-like-system ) ), and passing
242
- ` --set build.build=<triple> ` to ` ./configure ` .
247
+ [ Installing from Source] ( #installing-from-source ) ), and modifying the ` build `
248
+ option under the ` [build] ` section.
249
+
250
+ ### Configure and Make
251
+
252
+ While it's not the recommended build system, this project also provides a
253
+ configure script and makefile (the latter of which just invokes ` x.py ` ).
254
+
255
+ ``` sh
256
+ ./configure
257
+ make && sudo make install
258
+ ```
259
+
260
+ ` configure ` generates a ` config.toml ` which can also be used with normal ` x.py `
261
+ invocations.
243
262
244
263
## Building Documentation
245
264
@@ -255,12 +274,12 @@ will be `build\x86_64-pc-windows-msvc\doc`.
255
274
256
275
## Notes
257
276
258
- Since the Rust compiler is written in Rust , it must be built by a precompiled
277
+ Since the CrabLang compiler is written in CrabLang , it must be built by a precompiled
259
278
"snapshot" version of itself (made in an earlier stage of development).
260
279
As such, source builds require an Internet connection to fetch snapshots, and an
261
280
OS that can execute the available snapshot binaries.
262
281
263
- See https://doc.rust-lang .org/nightly/rustc /platform-support.html for a list of
282
+ See https://doc.crablang .org/nightly/crabc /platform-support.html for a list of
264
283
supported platforms.
265
284
Only "host tools" platforms have a pre-compiled snapshot binary available; to
266
285
compile for a platform without host tools you must cross-compile.
@@ -270,15 +289,15 @@ build environments that are most likely to work.
270
289
271
290
## Getting Help
272
291
273
- See https://www.rust-lang .org/community for a list of chat platforms and forums.
292
+ Need help? Join us on discord at https://community.crablang .org !
274
293
275
294
## Contributing
276
295
277
296
See [ CONTRIBUTING.md] ( CONTRIBUTING.md ) .
278
297
279
298
## License
280
299
281
- Rust is primarily distributed under the terms of both the MIT license and the
300
+ CrabLang is primarily distributed under the terms of both the MIT license and the
282
301
Apache License (Version 2.0), with portions covered by various BSD-like
283
302
licenses.
284
303
@@ -287,15 +306,11 @@ See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and
287
306
288
307
## Trademark
289
308
290
- [ The Rust Foundation] [ rust-foundation ] owns and protects the Rust and Cargo
291
- trademarks and logos (the "Rust Trademarks").
292
-
293
- If you want to use these names or brands, please read the
294
- [ media guide] [ media-guide ] .
309
+ If you want to use any names or brands associated with Crab or CrabLang, please feel free to do so in any capacity.
295
310
296
311
Third-party logos may be subject to third-party copyrights and trademarks. See
297
312
[ Licenses] [ policies-licenses ] for details.
298
313
299
- [ rust -foundation] : https://foundation.rust-lang .org/
300
- [ media-guide ] : https://foundation.rust-lang .org/policies/logo-policy-and-media-guide/
301
- [ policies-licenses ] : https://www.rust-lang .org/policies/licenses
314
+ [ crablang -foundation] : https://foundation.crablang .org/
315
+ [ media-guide ] : https://foundation.crablang .org/policies/logo-policy-and-media-guide/
316
+ [ policies-licenses ] : https://www.crablang .org/policies/licenses
0 commit comments