val val (eval) is a simple arbitrary precision calculator language built on top of chumsky and ariadne. Installation val should run on any system, including Linux, MacOS, and the BSDs. The easiest way to install it is by using cargo, the Rust package manager: cargo install val Pre-built binaries Pre-built binaries for Linux, MacOS, and Windows can be found on the releases page. Usage The primary way to use val is via the provided command-line interface. There is currently ongoing work on a Rust library and web playground, which will provide a few extra ways to interact with the runtime. Below is the output of val --help , which describes some of the arguments/options we support: Usage: val [OPTIONS] [FILENAME] Arguments: [FILENAME] Options: -e, --expression <EXPRESSION> -h, --help Print help -V, --version Print version Running val on its own will spawn a repl (read–eval–print loop) environment, where you can evaluate arbitrary val code and see its output immediately. We use rustyline for its implementation, and we support a few quality of life features: Syntax highlighting (see image above) Persistent command history Emacs-style editing support by default Filename completions Hints (virtual text pulled from history) The val language supports not only expressions, but quite a few statements as well. You may want to save val programs and execute them later, so the command-line interface provides a way to evaluate entire files. For instance, lets say you have the following val program at factorial.val : fn factorial ( n ) { if ( n <= 1 ) { return 1 } else { return n * factorial ( n - 1 ) } } println ( factorial ( 5 ) ) ; You can execute this program by running val factorial.val , which will write to standard output 120 . Lastly, you may want to evaluate a val expression and use it within another program. The tool supports executing arbitrary expressions inline using the --expression or -e option: val -e ' sin(2) * e ^ pi * cos(sum([1, 2, 3])) ' 16.481455793912883 n.b. ...
First seen: 2025-04-17 20:13
Last seen: 2025-04-18 01:14