1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! tatara-lisp-script — scripting surface for tatara-lisp.
//!
//! Wraps `tatara-lisp-eval::Interpreter<ScriptCtx>` with a batteries-included
//! stdlib (http, json, yaml, sops, file I/O, env, sha256, string ops) so a
//! `.tlisp` file can replace a bash script. The binary (`tatara-script`)
//! parses a .tlisp file, expands macros via tatara-lisp, and evaluates each
//! form against this stdlib.
//!
//! # Usage from nix-run
//!
//! ```nix
//! apps.tatara-script = {
//! type = "app";
//! program = "${tataraScript}/bin/tatara-script path/to/script.tlisp";
//! };
//! ```
//!
//! # Library surface
//!
//! Embedders that want to add domain-specific FFI on top of the stdlib can:
//!
//! ```rust,ignore
//! use tatara_lisp_script::{Interpreter, ScriptCtx, install_stdlib};
//!
//! let mut interp: Interpreter<ScriptCtx> = Interpreter::new();
//! let mut ctx = ScriptCtx::default();
//! install_stdlib(&mut interp, &mut ctx);
//! // Register more fns before eval_program.
//! ```
pub use ScriptCtx;
pub use install_stdlib;
// Re-export the evaluator so embedders don't have to depend on tatara-lisp-eval
// directly.
pub use ;
pub use ;
/// Convenience: read + evaluate a tatara-lisp source string against a fresh
/// interpreter with the full stdlib installed.
///
/// Primarily for tests and one-liner invocations. Binary entry points
/// should construct the `Interpreter` directly to keep the host context
/// available across calls.