[−][src]Crate tin
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#" pickFirst = |a: i32, b: i32| i32 { capture = |x: i32| i32 { a + x }; capture(b) }; main = || i32 { pickFirst(42i32, 62i32) }; "#; let mut tin = tin::Tin::new(); tin.load("main.tn", source)?; /* let mut module = tin.compile()?; let main = module.function::<tin::module::Function0<i32>>("main").unwrap(); let result = main(); assert_eq!(42, result); */
Re-exports
pub use crate::error::Error; |
pub use crate::error::Result; |
Modules
diagnostic | Utilities for producing human-readable diagnostics out of errors. |
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. |