eliaperantoni / koi Goto Github PK
View Code? Open in Web Editor NEWA friendly companion for your shell scripting journeys.
Home Page: https://koi-lang.dev/
License: MIT License
A friendly companion for your shell scripting journeys.
Home Page: https://koi-lang.dev/
License: MIT License
pls help how can i access argv (in python its sys.argv) in koi
Koi looks awesome! But seems to only be for *nix systems. Please tell me this also compiles and works on Windows?
When running a command in a shell script then $?
gives the return code of that command.
I did not find how I get the return code in a koi script.
Using the example from the docs:
$ echo 'print("Koi")' | koi -s
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/main.rs:77:51
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I believe this is due to this line:
Line 77 in caa13f7
Providing the -s
option conflicts with providing a path, so naturally matches.value_of("path") == None
.
Maybe the root can be set to the current directory if reading from stdin?
> rustc --version
rustc 1.54.0-nightly (c1e8f3a58 2021-05-30)
> cargo install --git https://github.com/eliaperantoni/Koi
...
warning: 3 warnings emitted
Finished release [optimized] target(s) in 2m 23s
Installing /home/user/.asdf/installs/rust/nightly/bin/koi
Installed package `koi v0.1.0 (https://github.com/eliaperantoni/Koi#caa13f7b)` (executable `koi`)
/home/user/tmp/koi/examples(master)> asdf reshim
/home/user/tmp/koi/examples(master)> koi
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:67:75
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
/home/user/tmp/koi/examples(master)> koi import.koi
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/interp/mod.rs:150:60
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Just a question. How would I issue a command like this?
ls -l *.pdf
Traceback in main.rs:65:9
-- "called Result::unwrap()
on an Err
value: Os { code: 2, kind: NotFound, message: "No such file or directory" }"
As it stands, if a function is called before it is declared positionally, it is not recognized, a possible multi-pass compilation/ parsing system could properly identify these symbols and fix what Bash failed to include.
print(something()) # This would cause a panic because it is declared after being called.
fn something() {
return "nothing"
}
Even the ability to predeclare functions could prove useful, however, order-independent function invoking is much more of a priority than something like this;
fn something() # Mostly just syntactic sugar.
print(something())
fn something() {
return "nothing"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.