mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
s/trunk/main/g
This commit is contained in:
parent
97e2900bf5
commit
7b2c1a7e64
10 changed files with 36 additions and 36 deletions
6
.github/workflows/benchmarks.yml
vendored
6
.github/workflows/benchmarks.yml
vendored
|
@ -20,14 +20,14 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: "trunk"
|
ref: "main"
|
||||||
clean: "true"
|
clean: "true"
|
||||||
|
|
||||||
- name: Earthly version
|
- name: Earthly version
|
||||||
run: earthly --version
|
run: earthly --version
|
||||||
|
|
||||||
- name: on trunk; prepare a self-contained benchmark folder
|
- name: on main; prepare a self-contained benchmark folder
|
||||||
run: ./ci/safe-earthly.sh --build-arg BENCH_SUFFIX=trunk +prep-bench-folder
|
run: ./ci/safe-earthly.sh --build-arg BENCH_SUFFIX=main +prep-bench-folder
|
||||||
|
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
|
4
.github/workflows/www.yml
vendored
4
.github/workflows/www.yml
vendored
|
@ -1,10 +1,10 @@
|
||||||
name: deploy www.roc-lang.org
|
name: deploy www.roc-lang.org
|
||||||
|
|
||||||
# Whenever a commit lands on trunk, deploy the site
|
# Whenever a commit lands on `main`, deploy the site
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- deploy-www # TODO change to trunk
|
- deploy-www
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
|
|
@ -12,13 +12,13 @@ use std::{
|
||||||
process::{self, Command, Stdio},
|
process::{self, Command, Stdio},
|
||||||
};
|
};
|
||||||
|
|
||||||
const BENCH_FOLDER_TRUNK: &str = "bench-folder-trunk";
|
const BENCH_FOLDER_MAIN: &str = "bench-folder-main";
|
||||||
const BENCH_FOLDER_BRANCH: &str = "bench-folder-branch";
|
const BENCH_FOLDER_BRANCH: &str = "bench-folder-branch";
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let optional_args: OptionalArgs = OptionalArgs::parse();
|
let optional_args: OptionalArgs = OptionalArgs::parse();
|
||||||
|
|
||||||
if Path::new(BENCH_FOLDER_TRUNK).exists() && Path::new(BENCH_FOLDER_BRANCH).exists() {
|
if Path::new(BENCH_FOLDER_MAIN).exists() && Path::new(BENCH_FOLDER_BRANCH).exists() {
|
||||||
delete_old_bench_results();
|
delete_old_bench_results();
|
||||||
|
|
||||||
if optional_args.check_executables_changed {
|
if optional_args.check_executables_changed {
|
||||||
|
@ -26,7 +26,7 @@ fn main() {
|
||||||
|
|
||||||
std::env::set_var("BENCH_DRY_RUN", "1");
|
std::env::set_var("BENCH_DRY_RUN", "1");
|
||||||
|
|
||||||
do_benchmark("trunk");
|
do_benchmark("main");
|
||||||
do_benchmark("branch");
|
do_benchmark("branch");
|
||||||
|
|
||||||
std::env::set_var("BENCH_DRY_RUN", "0");
|
std::env::set_var("BENCH_DRY_RUN", "0");
|
||||||
|
@ -49,9 +49,9 @@ fn main() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
eprintln!(
|
eprintln!(
|
||||||
r#"I can't find bench-folder-trunk and bench-folder-branch from the current directory.
|
r#"I can't find bench-folder-main and bench-folder-branch from the current directory.
|
||||||
I should be executed from the repo root.
|
I should be executed from the repo root.
|
||||||
Use `./ci/safe-earthly.sh --build-arg BENCH_SUFFIX=trunk +prep-bench-folder` to generate bench-folder-trunk.
|
Use `./ci/safe-earthly.sh --build-arg BENCH_SUFFIX=main +prep-bench-folder` to generate bench-folder-main.
|
||||||
Use `./ci/safe-earthly.sh +prep-bench-folder` to generate bench-folder-branch."#
|
Use `./ci/safe-earthly.sh +prep-bench-folder` to generate bench-folder-branch."#
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ fn finish(all_regressed_benches: HashSet<String>, nr_repeat_benchmarks: usize) {
|
||||||
// returns all benchmarks that have regressed
|
// returns all benchmarks that have regressed
|
||||||
fn do_all_benches(nr_repeat_benchmarks: usize) -> HashSet<String> {
|
fn do_all_benches(nr_repeat_benchmarks: usize) -> HashSet<String> {
|
||||||
delete_old_bench_results();
|
delete_old_bench_results();
|
||||||
do_benchmark("trunk");
|
do_benchmark("main");
|
||||||
let mut all_regressed_benches = do_benchmark("branch");
|
let mut all_regressed_benches = do_benchmark("branch");
|
||||||
|
|
||||||
// if no benches regressed this round, abort early
|
// if no benches regressed this round, abort early
|
||||||
|
@ -87,7 +87,7 @@ fn do_all_benches(nr_repeat_benchmarks: usize) -> HashSet<String> {
|
||||||
|
|
||||||
for _ in 1..nr_repeat_benchmarks {
|
for _ in 1..nr_repeat_benchmarks {
|
||||||
delete_old_bench_results();
|
delete_old_bench_results();
|
||||||
do_benchmark("trunk");
|
do_benchmark("main");
|
||||||
let regressed_benches = do_benchmark("branch");
|
let regressed_benches = do_benchmark("branch");
|
||||||
|
|
||||||
// if no benches regressed this round, abort early
|
// if no benches regressed this round, abort early
|
||||||
|
@ -229,17 +229,17 @@ fn calc_hashes_for_folder(benches_path_str: &str) -> HashMap<String, String> {
|
||||||
fn check_if_bench_executables_changed() -> bool {
|
fn check_if_bench_executables_changed() -> bool {
|
||||||
let bench_folder_str = "/examples/benchmarks/";
|
let bench_folder_str = "/examples/benchmarks/";
|
||||||
|
|
||||||
let trunk_benches_path_str = [BENCH_FOLDER_TRUNK, bench_folder_str].join("");
|
let main_benches_path_str = [BENCH_FOLDER_MAIN, bench_folder_str].join("");
|
||||||
let trunk_bench_hashes = calc_hashes_for_folder(&trunk_benches_path_str);
|
let main_bench_hashes = calc_hashes_for_folder(&main_benches_path_str);
|
||||||
|
|
||||||
let branch_benches_path_str = [BENCH_FOLDER_BRANCH, bench_folder_str].join("");
|
let branch_benches_path_str = [BENCH_FOLDER_BRANCH, bench_folder_str].join("");
|
||||||
let branch_bench_hashes = calc_hashes_for_folder(&branch_benches_path_str);
|
let branch_bench_hashes = calc_hashes_for_folder(&branch_benches_path_str);
|
||||||
|
|
||||||
if trunk_bench_hashes.keys().len() == branch_bench_hashes.keys().len() {
|
if main_bench_hashes.keys().len() == branch_bench_hashes.keys().len() {
|
||||||
for key in trunk_bench_hashes.keys() {
|
for key in main_bench_hashes.keys() {
|
||||||
if let Some(trunk_hash_val) = trunk_bench_hashes.get(key) {
|
if let Some(main_hash_val) = main_bench_hashes.get(key) {
|
||||||
if let Some(branch_hash_val) = branch_bench_hashes.get(key) {
|
if let Some(branch_hash_val) = branch_bench_hashes.get(key) {
|
||||||
if !trunk_hash_val.eq(branch_hash_val) {
|
if !main_hash_val.eq(branch_hash_val) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Dev Backend
|
# Dev Backend
|
||||||
|
|
||||||
The dev backend is focused on generating decent binaries extremely fast.
|
The dev backend is focused on generating decent binaries extremely fast.
|
||||||
It goes from Roc's [mono ir](https://github.com/roc-lang/roc/blob/trunk/compiler/mono/src/ir.rs) to an object file ready to be linked.
|
It goes from Roc's [mono ir](https://github.com/roc-lang/roc/blob/main/compiler/mono/src/ir.rs) to an object file ready to be linked.
|
||||||
|
|
||||||
## General Process
|
## General Process
|
||||||
|
|
||||||
|
@ -22,14 +22,14 @@ rust should be abled compile each specific target (`linux-arm`, `darwin-x86_64`,
|
||||||
|
|
||||||
### Backend
|
### Backend
|
||||||
|
|
||||||
[Backend](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/lib.rs) is the core abstraction.
|
[Backend](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/lib.rs) is the core abstraction.
|
||||||
It understands Roc's mono ir and some high level ideas about the generation process.
|
It understands Roc's mono ir and some high level ideas about the generation process.
|
||||||
The main job of Backend is to do high level optimizatons (like lazy literal loading) and parse the mono ir.
|
The main job of Backend is to do high level optimizatons (like lazy literal loading) and parse the mono ir.
|
||||||
Every target specific backend must implement this trait.
|
Every target specific backend must implement this trait.
|
||||||
|
|
||||||
### Backend64Bit
|
### Backend64Bit
|
||||||
|
|
||||||
[Backend64Bit](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs) is more or less what it sounds like.
|
[Backend64Bit](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/mod.rs) is more or less what it sounds like.
|
||||||
It is the backend that understands 64 bit architectures.
|
It is the backend that understands 64 bit architectures.
|
||||||
Currently it is the only backend implementation, but a 32 bit implementation will probably come in the future.
|
Currently it is the only backend implementation, but a 32 bit implementation will probably come in the future.
|
||||||
This backend understands that the unit of data movement is 64 bit.
|
This backend understands that the unit of data movement is 64 bit.
|
||||||
|
@ -44,18 +44,18 @@ Backend64Bit is generic over these types instead of containing these types withi
|
||||||
|
|
||||||
### Assembler
|
### Assembler
|
||||||
|
|
||||||
[Assembler](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs) is the trait for generating assembly bytes.
|
[Assembler](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/mod.rs) is the trait for generating assembly bytes.
|
||||||
It defines a set of RISC-like assembly calls that must be implemented for each architecture.
|
It defines a set of RISC-like assembly calls that must be implemented for each architecture.
|
||||||
A lot of these calls may not map one to one with actual assembly instructions for each architecture.
|
A lot of these calls may not map one to one with actual assembly instructions for each architecture.
|
||||||
Instead, they are a general abstraction over functionality shared between all architectures.
|
Instead, they are a general abstraction over functionality shared between all architectures.
|
||||||
This will grow regularly as more Roc builtins are added.
|
This will grow regularly as more Roc builtins are added.
|
||||||
Here are example implementations for [arm](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/aarch64.rs) and [x86_64](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/x86_64.rs).
|
Here are example implementations for [arm](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/aarch64.rs) and [x86_64](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/x86_64.rs).
|
||||||
|
|
||||||
### CallConv
|
### CallConv
|
||||||
|
|
||||||
[CallConv](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs) is the abstraction over calling conventions.
|
[CallConv](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/mod.rs) is the abstraction over calling conventions.
|
||||||
It deals with register and stack specific information related to passing and returning arguments.
|
It deals with register and stack specific information related to passing and returning arguments.
|
||||||
Here are example implementations for [arm](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/aarch64.rs) and [x86_64](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/x86_64.rs).
|
Here are example implementations for [arm](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/aarch64.rs) and [x86_64](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/x86_64.rs).
|
||||||
|
|
||||||
## Adding New Features
|
## Adding New Features
|
||||||
|
|
||||||
|
@ -67,16 +67,16 @@ This is the general procedure I follow with some helpful links:
|
||||||
1. Find a feature that is just n+1.
|
1. Find a feature that is just n+1.
|
||||||
For example, since we already have integers, adding a builtin that functions on them should be n+1.
|
For example, since we already have integers, adding a builtin that functions on them should be n+1.
|
||||||
On the other hand, since we don't yet have booleans/conditionals, adding if statements may not yet be n+1.
|
On the other hand, since we don't yet have booleans/conditionals, adding if statements may not yet be n+1.
|
||||||
A good place to look for missing features is in the test files for generation in [test_gen](https://github.com/roc-lang/roc/tree/trunk/compiler/test_gen). Any test that is not enabled for the `gen-dev` feature still needs to be added to the dev backend. Eventually all features should be enabled for the dev backend.
|
A good place to look for missing features is in the test files for generation in [test_gen](https://github.com/roc-lang/roc/tree/main/compiler/test_gen). Any test that is not enabled for the `gen-dev` feature still needs to be added to the dev backend. Eventually all features should be enabled for the dev backend.
|
||||||
1. Pick/write the simplest test case you can find for the new feature.
|
1. Pick/write the simplest test case you can find for the new feature.
|
||||||
Just add `feature = "gen-dev"` to the `cfg` line for the test case.
|
Just add `feature = "gen-dev"` to the `cfg` line for the test case.
|
||||||
1. Uncomment the code to print out procedures [from here](https://github.com/roc-lang/roc/blob/b03ed18553569314a420d5bf1fb0ead4b6b5ecda/compiler/test_gen/src/helpers/dev.rs#L76) and run the test.
|
1. Uncomment the code to print out procedures [from here](https://github.com/roc-lang/roc/blob/b03ed18553569314a420d5bf1fb0ead4b6b5ecda/compiler/test_gen/src/helpers/dev.rs#L76) and run the test.
|
||||||
It should fail and print out the mono ir for this test case.
|
It should fail and print out the mono ir for this test case.
|
||||||
Seeing the actual mono ir tends to be very helpful for complex additions.
|
Seeing the actual mono ir tends to be very helpful for complex additions.
|
||||||
1. Generally it will fail in one of the match statements in the [Backend](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/lib.rs) trait.
|
1. Generally it will fail in one of the match statements in the [Backend](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/lib.rs) trait.
|
||||||
Add the correct pattern matching and likely new function for your new builtin.
|
Add the correct pattern matching and likely new function for your new builtin.
|
||||||
This will break the compile until you add the same function to places that implement the trait,
|
This will break the compile until you add the same function to places that implement the trait,
|
||||||
like [Backend64Bit](https://github.com/roc-lang/roc/blob/trunk/compiler/gen_dev/src/generic64/mod.rs).
|
like [Backend64Bit](https://github.com/roc-lang/roc/blob/main/compiler/gen_dev/src/generic64/mod.rs).
|
||||||
1. Keep following the chain down.
|
1. Keep following the chain down.
|
||||||
To implement the function in Backend64Bit, you may need to add new assembly calls.
|
To implement the function in Backend64Bit, you may need to add new assembly calls.
|
||||||
Feel free to ignore backends that aren't x86_64 for now and just add `unimplemented!`.
|
Feel free to ignore backends that aren't x86_64 for now and just add `unimplemented!`.
|
||||||
|
|
|
@ -414,7 +414,7 @@ async fn create_device(
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.expect(r#"Request adapter
|
.expect(r#"Request adapter
|
||||||
If you're running this from inside nix, follow the instructions here to resolve this: https://github.com/roc-lang/roc/blob/trunk/BUILDING_FROM_SOURCE.md#editor
|
If you're running this from inside nix, follow the instructions here to resolve this: https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md#editor
|
||||||
"#);
|
"#);
|
||||||
|
|
||||||
let color_format = surface.get_preferred_format(&adapter).unwrap();
|
let color_format = surface.get_preferred_format(&adapter).unwrap();
|
||||||
|
|
|
@ -73,7 +73,7 @@ pub fn run_event_loop(title: &str, window_bounds: Bounds) -> Result<(), Box<dyn
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.expect(r#"Request adapter
|
.expect(r#"Request adapter
|
||||||
If you're running this from inside nix, follow the instructions here to resolve this: https://github.com/roc-lang/roc/blob/trunk/BUILDING_FROM_SOURCE.md#editor
|
If you're running this from inside nix, follow the instructions here to resolve this: https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md#editor
|
||||||
"#);
|
"#);
|
||||||
|
|
||||||
adapter
|
adapter
|
||||||
|
|
|
@ -56,7 +56,7 @@ fn run_event_loop(title: &str, root: RocElem) -> Result<(), Box<dyn Error>> {
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
.expect(r#"Request adapter
|
.expect(r#"Request adapter
|
||||||
If you're running this from inside nix, follow the instructions here to resolve this: https://github.com/roc-lang/roc/blob/trunk/BUILDING_FROM_SOURCE.md#editor
|
If you're running this from inside nix, follow the instructions here to resolve this: https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md#editor
|
||||||
"#);
|
"#);
|
||||||
|
|
||||||
adapter
|
adapter
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
zlib
|
zlib
|
||||||
libiconv
|
libiconv
|
||||||
|
|
||||||
# faster builds - see https://github.com/roc-lang/roc/blob/trunk/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
|
# faster builds - see https://github.com/roc-lang/roc/blob/main/BUILDING_FROM_SOURCE.md#use-lld-for-the-linker
|
||||||
llvmPkgs.lld
|
llvmPkgs.lld
|
||||||
debugir
|
debugir
|
||||||
rust
|
rust
|
||||||
|
|
|
@ -4,9 +4,9 @@ Roc is a language for making delightful software. It does not have an 0.1 releas
|
||||||
certainly don't recommend using it in production in its current state! However, it can be fun to
|
certainly don't recommend using it in production in its current state! However, it can be fun to
|
||||||
play around with as long as you have a high tolerance for missing features and compiler bugs. :)
|
play around with as long as you have a high tolerance for missing features and compiler bugs. :)
|
||||||
|
|
||||||
The [tutorial](TUTORIAL.md) is the best place to learn about how to use the language - it assumes no prior knowledge of Roc or similar languages. (If you already know [Elm](https://elm-lang.org/), then [Roc for Elm Programmers](https://github.com/roc-lang/roc/blob/trunk/roc-for-elm-programmers.md) may be of interest.)
|
The [tutorial](TUTORIAL.md) is the best place to learn about how to use the language - it assumes no prior knowledge of Roc or similar languages. (If you already know [Elm](https://elm-lang.org/), then [Roc for Elm Programmers](https://github.com/roc-lang/roc/blob/main/roc-for-elm-programmers.md) may be of interest.)
|
||||||
|
|
||||||
There's also a folder of [examples](https://github.com/roc-lang/roc/tree/trunk/examples) - the [CLI form example](https://github.com/roc-lang/roc/tree/trunk/examples/interactive/form.roc) in particular is a reasonable starting point to build on.
|
There's also a folder of [examples](https://github.com/roc-lang/roc/tree/main/examples) - the [CLI form example](https://github.com/roc-lang/roc/tree/main/examples/interactive/form.roc) in particular is a reasonable starting point to build on.
|
||||||
|
|
||||||
If you have a specific question, the [FAQ](FAQ.md) might have an answer, although [Roc Zulip chat](https://roc.zulipchat.com) is overall the best place to ask questions and get help! It's also where we discuss [ideas](https://roc.zulipchat.com/#narrow/stream/304641-ideas) for the language. If you want to get involved in contributing to the language, Zulip is also a great place to ask about good first projects.
|
If you have a specific question, the [FAQ](FAQ.md) might have an answer, although [Roc Zulip chat](https://roc.zulipchat.com) is overall the best place to ask questions and get help! It's also where we discuss [ideas](https://roc.zulipchat.com/#narrow/stream/304641-ideas) for the language. If you want to get involved in contributing to the language, Zulip is also a great place to ask about good first projects.
|
||||||
|
|
||||||
|
@ -43,4 +43,4 @@ never done anything with Rust and also never worked on a compiler, but we've
|
||||||
been able to find beginner-friendly projects to get people up to speed gradually.)
|
been able to find beginner-friendly projects to get people up to speed gradually.)
|
||||||
|
|
||||||
If you're interested in getting involved, check out
|
If you're interested in getting involved, check out
|
||||||
[CONTRIBUTING.md](https://github.com/roc-lang/roc/blob/trunk/CONTRIBUTING.md)!
|
[CONTRIBUTING.md](https://github.com/roc-lang/roc/blob/main/CONTRIBUTING.md)!
|
||||||
|
|
|
@ -3,7 +3,7 @@ How to update www.roc-lang.org :
|
||||||
|
|
||||||
|
|
||||||
- create a new branch, for example `update-www` based on `www`
|
- create a new branch, for example `update-www` based on `www`
|
||||||
- pull `trunk` into `update-www`
|
- pull `main` into `update-www`
|
||||||
- update for example the file `www/public/index.html`
|
- update for example the file `www/public/index.html`
|
||||||
- do a PR against `www`
|
- do a PR against `www`
|
||||||
- check deploy preview
|
- check deploy preview
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue