PistonDevelopers / dyon

A rusty dynamically typed scripting language
Apache License 2.0
1.77k stars 55 forks source link

Added REPL #736

Closed bvssvni closed 1 year ago

bvssvni commented 1 year ago

See https://github.com/PistonDevelopers/dyon/issues/735

Example:

=== Dyon 0.48 ===
Type `help` for more information.
> sum i 100 {i}
4950

Comments about the design

Adds a new "dyon" example which can be installed using:

cargo install --example dyon dyon

To run, type:

dyon

I have previously been too much focused on thinking about REPLs where you declare variables and put them in the context. Dyon is designed to load modules without allocating memory. Instead of trying to change Dyon's design, I think the best solution is to build a REPL around the common use of Dyon.

One can use mathematical notation for functions to e.g. declare constants:

a() = 3
bvssvni commented 1 year ago

Merging.