13 breaking releases

new 0.14.0 Apr 17, 2024
0.12.0 Oct 18, 2023
0.11.0 Jul 14, 2022
0.10.0 Dec 2, 2021
0.5.0 Dec 17, 2020

#200 in Programming languages

Download history 33/week @ 2024-01-01 1/week @ 2024-02-19 13/week @ 2024-02-26 2/week @ 2024-03-04 7/week @ 2024-03-11 118/week @ 2024-04-01 14/week @ 2024-04-08 154/week @ 2024-04-15

286 downloads per month
Used in 2 crates

MIT license

1MB
19K SLoC

Koto


Docs Crates.io CI Discord


Koto is a simple and expressive programming language, usable as an extension language for Rust applications, or as a standalone scripting language.

Info

MSRV

Koto is under active development, and tested against the latest stable release of Rust.


lib.rs:

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::prelude::*;

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

Dependencies

~1.8–10MB
~75K SLoC