Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#620 Changed bend run to bend run-rs and bend run defaults to the C implementation #630

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 7 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 {
Expand All @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/cli__debug_list_map.bend.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
2 changes: 1 addition & 1 deletion tests/snapshots/cli__debug_u60_to_nat.bend.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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'.
Loading