zydeco-lang/zydeco

Better Command Line Interface

maxsnew opened this issue · 4 comments

This seems to be a nice library: https://docs.rs/clap/latest/clap/

What's the expectation for the interface? I can only think of eval, repl and test.

BTW, I highly recommend the clap crate above (and personally used a lot). I love the idea of using procedural macros on data types in a declarative sense.

Here's some basics that should be supported:

  1. help should print usage information which is very much needed
  2. run to run the interpreter on a file.
  3. check to parse/typecheck but not run
  4. repl to run the interpreter interactively

We certainly need some form of testing as well but we should think through the design a bit more.

Addressed in 18611c2. To be honest this is the part of codebase I don't like right now. crate::cli::zydeco::Zydeco is fine, but crate::cli::entry is just so ugly that I don't want to inspect it again as long as it works. When we add test framework we should have a new main function redesigned if possible.

This is a good start. Thanks!