mink

Crates.iomink
lib.rsmink
version0.1.1
sourcesrc
created_at2022-08-13 16:12:48.033739
updated_at2022-08-13 16:15:52.650264
description(WIP) Portable and modular scripting language for all
homepage
repository
max_upload_size
id644924
size33,679
Gabriel (arujano)

documentation

README

Mink

The scripting language for all

Mink is a fast, simple and modular scripting language built on top of Rust. While it was originally targeted as a language for game engines, it now lives as a general-purpose language for any project.

Simple

Mink's syntax is simple, clear and explicit. On the user-end, it allows for dynamic typing and fast prototyping.

Developer-friendly

On the developer-end, Mink focuses on providing a simple but powerful API. Mink is completely modular as a language, allowing developers to implement their own libraries with ease (even the standard library!).

Example: Greet

print("Hi, Diego!")
use mink::*;

fn main() {
    let mut vm = Mink::new();
    
    let script = Script::new("greeting", include_str!("greeting.mink"));
    vm.add_script(script);
    
    vm.exec("greeting");
}

Example: Custom Library

// mathlib.rs
use mink::*;

pub fn lib() -> Library {
    let mut lib = Library::new("math", true);
    lib.add_func(Function::new("mag", Some(2), math_mag));
    lib
}

fn math_mag(_: &Mink, args: Vec<Value>) -> Value {
    let x = args[0].num();
    let y = args[1].num();
    Value::Num((x * x + y * y).sqrt())
}
// main.rs
mod mathlib;

use mink::*;

fn main() {
    let vm = Mink::new();
    vm.add_lib(mathlib::lib());
}
Commit count: 0

cargo fmt