Crate tin_lang

Crate tin_lang 

Source
Expand description

Tin is a simple embeddable programming language.

The aim is to have a very light-weight footprint and a simple API.

§Examples

let source = r#"
Int = 0u32;
pickFirst = |a: Int, b: Int| Int {
  capture = |x: Int| Int { a };
  capture(b)
};
main = || Int { pickFirst(42u32, 62u32) };
"#;

let mut tin = tin_lang::Tin::new();
tin.load(source)?;

/*
let mut module = tin.compile()?;
let main = module.function::<tin_lang::module::Function0<u32>>("main").unwrap();

let result = main();
assert_eq!(42, result);
*/

Re-exports§

pub use error::Error;
pub use error::Result;

Modules§

error
Common error types and utilities.
graph
Graph rendering tools for the internal representation of Tin code.
module
Definitions for compiled modules.

Structs§

Tin
An instance of the Tin runtime.