This repository has been archived by the owner on Aug 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
fixup: CLI arguments for C, CPP, Go, Ruby #25
Merged
Merged
Conversation
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
rvolosatovs
suggested changes
Jul 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, let's make sure all of these are consistent
rjzak
force-pushed
the
fix_c_cpp_go_ruby
branch
4 times, most recently
from
July 28, 2022 19:00
a2c740d
to
c4a55d5
Compare
rvolosatovs
suggested changes
Jul 28, 2022
rvolosatovs
reviewed
Jul 28, 2022
rvolosatovs
reviewed
Jul 28, 2022
rvolosatovs
reviewed
Jul 28, 2022
rjzak
force-pushed
the
fix_c_cpp_go_ruby
branch
3 times, most recently
from
July 28, 2022 21:28
1eb81f2
to
82d3b4c
Compare
rvolosatovs
reviewed
Jul 29, 2022
rjzak
force-pushed
the
fix_c_cpp_go_ruby
branch
from
August 1, 2022 20:40
82d3b4c
to
a61b897
Compare
rvolosatovs
suggested changes
Aug 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C, C++ and Go examples still incorrectly handle negative numbers:
$ nix build github:rjzak/codex/fix_c_cpp_go_ruby#fibonacci-cpp
$ echo -1 | enarx run ./result/main.wasm
Which Fibonacci index to find? Fibonacci sequence number at index -1 is -1
$ nix build github:rjzak/codex/fix_c_cpp_go_ruby#fibonacci-c
$ echo -1 | enarx run ./result/main.wasm
Which Fibonacci index to find? Fibonacci sequence number at index -1 is -1
$ nix build github:rjzak/codex/fix_c_cpp_go_ruby#fibonacci-go
$ echo -1 | enarx run ./result/main.wasm
Which Fibonacci index to find? Fibonacci sequence number at index -1 is -1
Meanwhile, Rust and Zig:
$ nix build github:rjzak/codex/fix_c_cpp_go_ruby#fibonacci-rust
$ echo -1 | enarx run ./result/main.wasm
Enter a non-negative number:
thread 'main' panicked at 'Failed to parse number: ParseIntError { kind: InvalidDigit }', src/main.rs:23:38
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: KVM error: Shutdown
$ nix build github:rjzak/codex/fix_c_cpp_go_ruby#fibonacci-zig
$ echo -1 | enarx run ./result/main.wasm
No arguments specified, please specify Fibonacci sequence index:
error: InvalidCharacter
Error: failed to execute default function
Caused by:
Exited with i32 exit status 1
wasm backtrace:
0: 0x35ae - <unknown>!<wasm function 17>
rvolosatovs
reviewed
Aug 1, 2022
rvolosatovs
reviewed
Aug 1, 2022
rvolosatovs
reviewed
Aug 1, 2022
rvolosatovs
reviewed
Aug 1, 2022
rvolosatovs
reviewed
Aug 1, 2022
Signed-off-by: Richard Zak <[email protected]>
rjzak
force-pushed
the
fix_c_cpp_go_ruby
branch
from
August 1, 2022 22:21
a61b897
to
f685d54
Compare
rvolosatovs
approved these changes
Aug 1, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, approving to unblock this and the rest will be fixed in a follow-up!
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
Signed-off-by: Roman Volosatovs <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
C, C++, Go, Ruby receive command line input instead of
stdin
.Refs #23
Go has a
go.mod
to allow it to be built easily with regular Go.Overall cleanup for consistency.