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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//! The alchemy language: declarative streaming transducers and renderers
//! for the tabnas engine, parsed by a tabnas grammar plugin; and the types
//! every tabnas transducer and renderer shares.
//!
//! [`shared`] is the types: the event and table protocols, sinks,
//! failures and their codes, limits, selectors, datums, the renderers'
//! options and text boundary, and the two interfaces a program is lowered
//! through, [`shared::Routers`] and [`shared::Renderers`]. It depends on
//! nothing else in the fleet; with `default-features = false` it is the
//! whole crate, and tabnas-transduce and tabnas-render build on it.
//!
//! Everything else is the language, behind the default `language`
//! feature. The reader:
//!
//! - [`lex`] and [`grammar`]: the grammar plugin, installed on an engine
//! with [`alchemy`], or built with [`make`]; [`parse_value`] answers the
//! reader's tagged tree and [`parse`] the [`Expr`] forms.
//! - [`ast`]: [`Expr`] with [`SourceSpan`]s, the [`canonical`] and layout
//! [`format`] printers, and [`MAX_NESTING`], the bound every form this
//! crate builds respects.
//! - [`desugar`]: the core-form rewrites (`def` with parameters, `pipe`,
//! the shapes of `let`, `if` and `match`).
//!
//! The language, reading [`Expr`] after [`desugar`] has run:
//!
//! - [`resolve`]: scopes and linking; [`types`] and [`check`]: inference,
//! affine streams, protocols, strict mode; [`effects`]: the effect
//! summary and the `explain` report.
//! - [`value`]: runtime values, every one `Send`, with streams and texts
//! as plans; [`interp`]: the evaluator; [`lower`]: plans to the stages
//! the host's routers and renderers make; [`stdlib`]: the natives and
//! the embedded library.
//! - [`program`]: [`compile`] and [`Program`], the API a host embeds. The
//! host passes the routers (tabnas-transduce's) and the renderers
//! (tabnas-render's) in; the `alchemy` command, which does, is
//! tabnas-alchemy-cli.
//!
//! ```
//! use tabnas_alchemy::{canonical, desugar, parse};
//! let src = "def export [input]\n pipe input\n table-from-json api-binding\n csv csv-options";
//! let core = desugar::program(parse(src)?, src)?;
//! assert_eq!(
//! canonical(&core),
//! "(def export (fn [input] (csv csv-options (table-from-json api-binding input))))"
//! );
//! # Ok::<(), tabnas_alchemy::shared::Fail>(())
//! ```
// The crate's documentation above names the language, which a build
// without the `language` feature leaves out.
/// The README's Rust examples run as doctests, so a stale one fails the
/// gate rather than misleading the reader.
pub use ;
pub use MAX_APPLIED;
pub use ;
pub use ;
pub use ;
/// The stack the checker and the evaluator are given: [`compile`] runs on
/// a thread of this size, and so does the `alchemy` command, so a program
/// at [`MAX_NESTING`] and an evaluation at [`MAX_EVAL_DEPTH`] fit in a
/// debug build as in a release one. A host that pushes events into a
/// [`Program::sink`] runs the program's per-item functions on its own
/// thread and gives it at least this much (aless's parse thread has it).
pub const STACK_BYTES: usize = 64 << 20;
/// This crate's version, as `Cargo.toml` declares it.
pub const VERSION: &str = env!;