raton 0.1.0-alpha.2

ratón is a tiny, modular, embeddable scripting language
Documentation

Ratón 🐁

Documentation crates.io Build

A tiny, highly modular, embeddable, dynamically typed scripting language with a bytecode VM, intended for use in games.

Example

[dependences]
raton = {
  version = "0",
  features = ["i32_type", "while_loop", "single_line_comment"],
  default-features = false
}
// Add up all integers from 1 to n
fn sum_to_n(n) {
    let i = 0;
    let sum = 0;
    while (i < n) {
        i = i + 1;
        sum = sum + i;
    }
    return sum;
}

Status

Unfinished, do not use in production.

Components

  • Parser
  • Bytecode generator
  • Bytecode linker
  • Bytecode VM
  • Optimizer
  • Modular standard library

Modular type system

  • null
  • bool (optional bool_type feature)
  • i32 (optional i32_type feature)
  • f32 (optional f32_type feature)
  • string (optional string_type feature)
  • Host value (optional)
  • Host reference (optional)

Modular language features

  • if, else (optional if_expression feature)
  • while, break, continue (optional while_loop feature)
  • // comments (optional single_line_comment feature)
  • /* */ comments (optional multi_line_comment feature)

Serialization

  • serde (ast and bytecode)
  • bitcode (bytecode only)

Other features

  • Portable to any platform, 32 bits or higher, supported by Rust
  • Fuzzing (cargo fuzz run fuzz -- -timeout=5)
  • #![forbid(unsafe_code)], also validated in Miri
  • no_std
  • Denial of service prevention
  • Proper error handling
  • Proper error messages
  • Lexical scope

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.