Merge pull request #630 from bhavik-goplani/dev

#620 Changed `bend run` to `bend run-rs` and `bend run` defaults to the C implementation
This commit is contained in:
Nicolas Abril 2024-07-15 15:22:45 +00:00 committed by GitHub
commit 060239a055
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 13 additions and 8 deletions

View File

@ -52,6 +52,7 @@ and this project does not currently adhere to a particular versioning scheme.
- Add repeated field name error message.
- Add `Math` builtin functions. ([#570][gh-570])
- Add primitive file IO function `IO/FS/flush`. ([#598][gh-598])
- Changed `bend run` to `bend run-rs` and `bend run` defaults to the C implementation. ([#620][gh-620])
## [0.2.35] - 2024-06-06
@ -393,5 +394,6 @@ and this project does not currently adhere to a particular versioning scheme.
[gh-596]: https://github.com/HigherOrderCO/Bend/issues/596
[gh-598]: https://github.com/HigherOrderCO/Bend/issues/598
[gh-618]: https://github.com/HigherOrderCO/Bend/issues/618
[gh-620]: https://github.com/HigherOrderCO/Bend/issues/620
[gh-623]: https://github.com/HigherOrderCO/Bend/issues/623
[Unreleased]: https://github.com/HigherOrderCO/Bend/compare/0.2.36...HEAD

View File

@ -74,7 +74,8 @@ bend --version
### Getting Started
#### Running Bend Programs
```sh
bend run <file.bend> # uses the Rust interpreter (sequential)
bend run <file.bend> # uses the C interpreter by default (parallel)
bend run-rs <file.bend> # uses the Rust interpreter (sequential)
bend run-c <file.bend> # uses the C interpreter (parallel)
bend run-cu <file.bend> # uses the CUDA interpreter (massively parallel)

View File

@ -48,8 +48,9 @@ enum Mode {
path: PathBuf,
},
/// Compiles the program and runs it with the Rust HVM implementation.
Run(RunArgs),
RunRs(RunArgs),
/// Compiles the program and runs it with the C HVM implementation.
#[command(alias = "run")]
RunC(RunArgs),
/// Compiles the program and runs it with the Cuda HVM implementation.
RunCu(RunArgs),
@ -282,8 +283,9 @@ fn execute_cli_mode(mut cli: Cli) -> Result<(), Diagnostics> {
let run_cmd = match &cli.mode {
Mode::RunC(..) => "run-c",
Mode::RunRs(..) => "run",
Mode::RunCu(..) => "run-cu",
_ => "run",
_ => "run-c",
};
match cli.mode {
@ -307,9 +309,9 @@ fn execute_cli_mode(mut cli: Cli) -> Result<(), Diagnostics> {
println!("{}", hvm_book_show_pretty(&compile_res.hvm_book));
}
Mode::Run(RunArgs { pretty, run_opts, comp_opts, warn_opts, path, arguments })
| Mode::RunC(RunArgs { pretty, run_opts, comp_opts, warn_opts, path, arguments })
| Mode::RunCu(RunArgs { pretty, run_opts, comp_opts, warn_opts, path, arguments }) => {
Mode::RunC(RunArgs { pretty, run_opts, comp_opts, warn_opts, path, arguments })
| Mode::RunCu(RunArgs { pretty, run_opts, comp_opts, warn_opts, path, arguments })
| Mode::RunRs(RunArgs { pretty, run_opts, comp_opts, warn_opts, path, arguments }) => {
let CliRunOpts { linear, print_stats } = run_opts;
let diagnostics_cfg =

View File

@ -6,6 +6,6 @@ error: unexpected argument '-d' found
tip: to pass '-d' as a value, use '-- -d'
Usage: bend run [OPTIONS] <PATH> [ARGUMENTS]...
Usage: bend run-c [OPTIONS] <PATH> [ARGUMENTS]...
For more information, try '--help'.

View File

@ -6,6 +6,6 @@ error: unexpected argument '-d' found
tip: to pass '-d' as a value, use '-- -d'
Usage: bend run [OPTIONS] <PATH> [ARGUMENTS]...
Usage: bend run-c [OPTIONS] <PATH> [ARGUMENTS]...
For more information, try '--help'.