diff --git a/CHANGELOG.md b/CHANGELOG.md index 99f1b9fcf..66dae9232 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 338181fb1..47aed4afa 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ bend --version ### Getting Started #### Running Bend Programs ```sh -bend run # uses the Rust interpreter (sequential) +bend run # uses the C interpreter by default (parallel) +bend run-rs # uses the Rust interpreter (sequential) bend run-c # uses the C interpreter (parallel) bend run-cu # uses the CUDA interpreter (massively parallel) diff --git a/src/main.rs b/src/main.rs index b6fdcd315..82f3cc230 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 = diff --git a/tests/snapshots/cli__debug_list_map.bend.snap b/tests/snapshots/cli__debug_list_map.bend.snap index de105f53b..faa906525 100644 --- a/tests/snapshots/cli__debug_list_map.bend.snap +++ b/tests/snapshots/cli__debug_list_map.bend.snap @@ -6,6 +6,6 @@ error: unexpected argument '-d' found tip: to pass '-d' as a value, use '-- -d' -Usage: bend run [OPTIONS] [ARGUMENTS]... +Usage: bend run-c [OPTIONS] [ARGUMENTS]... For more information, try '--help'. diff --git a/tests/snapshots/cli__debug_u60_to_nat.bend.snap b/tests/snapshots/cli__debug_u60_to_nat.bend.snap index 6d607824c..5f55b13e8 100644 --- a/tests/snapshots/cli__debug_u60_to_nat.bend.snap +++ b/tests/snapshots/cli__debug_u60_to_nat.bend.snap @@ -6,6 +6,6 @@ error: unexpected argument '-d' found tip: to pass '-d' as a value, use '-- -d' -Usage: bend run [OPTIONS] [ARGUMENTS]... +Usage: bend run-c [OPTIONS] [ARGUMENTS]... For more information, try '--help'.