#scripting #language #koto

koto

A simple, expressive, embeddable programming language

13 releases (breaking)

0.11.0 Jul 14, 2022
0.10.0 Dec 2, 2021
0.9.1 Nov 1, 2021
0.7.0 Mar 27, 2021
0.5.0 Dec 17, 2020

#89 in Programming languages

Download history 5/week @ 2022-11-28 13/week @ 2022-12-05 11/week @ 2022-12-12 26/week @ 2022-12-19 7/week @ 2022-12-26 5/week @ 2023-01-02 3/week @ 2023-01-09 3/week @ 2023-01-16 9/week @ 2023-01-23 17/week @ 2023-01-30 17/week @ 2023-02-06 65/week @ 2023-02-13 31/week @ 2023-02-20 2/week @ 2023-02-27 5/week @ 2023-03-06 4/week @ 2023-03-13

57 downloads per month
Used in koto_cli

MIT license

1MB
20K SLoC

Koto

Pulls together the compiler and runtime for the Koto programming language.

Programs can be compiled and executed with the [Koto] struct.

Example

use koto::{Koto, runtime::Value};

let mut koto = Koto::default();
match koto.compile("1 + 2") {
    Ok(_) => match koto.run() {
        Ok(result) => match result {
            Value::Number(n) => println!("{n}"), // 3.0
            other => panic!("Unexpected result: {}", other),
        },
        Err(runtime_error) => {
            panic!("Runtime error: {runtime_error}");
        }
    },
    Err(compiler_error) => {
        panic!("Compiler error: {compiler_error}");
    }
}

Dependencies

~1.1–2.8MB
~53K SLoC