-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update CONTRIBUTING.md and README.md
- Loading branch information
Showing
2 changed files
with
40 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,8 @@ | ||
# Core | ||
# moonbitlang/core | ||
|
||
MoonBit's standard library. | ||
moonbitlang/core is the standard library of the MoonBit language. It is released alongside the compiler. You can view the documentation for the latest official release at <https://mooncakes.io/docs/#/moonbitlang/core/>. This repository serves as the development repository. | ||
|
||
⚠️ **The standard library is still in experimental phase**. | ||
## Contributing | ||
We are actively developing moonbitlang/core and appreciate your help! | ||
|
||
Developers who want to experience the standard library in advance can add the `--std` option after the `moon check`, `moon build`, `moon run` or `moon test` commands. This will link the standard library to the current project. | ||
|
||
## Example | ||
|
||
1. To create a new project, use the `moon new` command as shown below: | ||
|
||
```bash | ||
$ moon new | ||
Enter the path to create the project (. for current directory): my-project | ||
Select the create mode: exec | ||
Enter your username: username | ||
Enter your project name: hello | ||
Enter your license: Apache-2.0 | ||
Created my-project | ||
``` | ||
|
||
2. Replace the contents of `my-project/main/main.mbt` with the following code: | ||
|
||
```rust | ||
fn init { | ||
println(@list.reverse(@list.of_array([1, 2, 3]))) | ||
} | ||
``` | ||
|
||
The code snippet uses `reverse` and `of_array` from the standard library `moonbitlang/core/list`. | ||
|
||
3. If everything is configured correctly, the output should be: | ||
|
||
```bash | ||
$ moon run main --std | ||
of_array([3, 2, 1]) | ||
``` | ||
To contribute, please read the contribution guidelines at [CONTRIBUTING.md](./CONTRIBUTING.md). |