Crate spaik

source ·
Expand description

The SPAIK-LISP Programming Language

This is the documentation for SPAIK an embeddable Lisp dialect for Rust.

(dolist (x '(this new unknown))
  (println "Hello, {x} World!"))
Hello, this World!
Hello, new World!
Hello, unknown World!

Running SPAIK from Rust

use spaik::Spaik;

let mut vm = Spaik::new();
vm.exec(r#"(println "code")"#).unwrap();
let res: f32 = vm.eval(r#"(sqrt (+ 1 2))"#).unwrap();

Re-exports

  • pub use crate::error::Error;
  • pub use crate::error::Result;

Modules

  • Structured Errors
  • The easiest way to get started with SPAIK is use spaik::prelude::*
  • This is NOT a public interface. Dependencies for procedural macros (feature “derive”.)
  • Interactive Read-Eval-Print-Loop

Structs

  • Object for use in SPAIK examples
  • Thread-safe reference-counted smart-pointer. Cheap to clone. Used to refer to Userdata stored on the SPAIK heap.
  • A type that all SPAIK values may be converted to.
  • Promise made to SpaikPlug
  • Safe Primitive Value, a way of safely referring to GC storage
  • A SPAIK Context, this is the main way to use SPAIK
  • Asynchronous SPAIK, in another thread

Enums

Traits

  • Structs that can be stored inline in the GC Arena memory must implement this trait.
  • The mem parameter is necessary here, because some of the conversions may need to create an SPV reference-counter
  • The mem parameter is necessary here, because some of the conversions may need to do memory allocation.

Functions

  • Remove unneeded whitespace from SPAIK code.
  • Run SPAIK tests from the ./tests directory and report any errors.
  • SPAIK scratchpad for use in development of SPAIK itself. Rust doesn’t have a good REPL, this is my substitute. Changes to this file should not be commited to git.

Type Definitions

Attribute Macros

Derive Macros