Giter VIP home page Giter VIP logo

koi's People

Contributors

eliaperantoni avatar fuwn avatar ryangjchandler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

koi's Issues

Windows Support?

Koi looks awesome! But seems to only be for *nix systems. Please tell me this also compiles and works on Windows?

Reading from stdin panics

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:

interpreter.set_root(matches.value_of("path").unwrap());

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?

NotFound: No such file or directory

> 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

Crash on run

Traceback in main.rs:65:9 -- "called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }"

Possible multi-pass compilation/ parsing

Issue

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.

Example

print(something()) # This would cause a panic because it is declared after being called.

fn something() {
  return "nothing"
}

Notes

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"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.