tancore/lib.rs
1pub mod arithmetic;
2pub mod bool;
3pub mod buffer;
4pub mod char;
5pub mod cmp;
6pub mod dec;
7pub mod eq;
8pub mod error;
9pub mod float;
10pub mod int;
11pub mod io;
12pub mod lang;
13pub mod map;
14pub mod math;
15pub mod maybe;
16pub mod path;
17pub mod prelude;
18pub mod process;
19pub mod range;
20pub mod seq;
21pub mod set;
22pub mod string;
23pub mod u8;
24
25use tan::context::Context;
26
27use self::{
28 dec::import_lib_dec, math::import_lib_math, path::import_lib_path, prelude::import_lib_prelude,
29 process::import_lib_process, set::import_lib_set,
30};
31
32// #todo consider extracting as a (temporary?) crate, e.g. tan-stdlib-native, tan-native-lib, tan-runtime
33// #todo add unit test for the foreign-functions.
34
35// #todo consider extracting builtins.
36
37// #todo helper function or macro for arithmetic operations!
38// #todo also eval 'if', 'do', 'for' and other keywords here!
39// #todo use macros to monomorphise functions? or can we leverage Rust's generics? per viariant? maybe with cost generics?
40// #todo support overloading,
41// #todo make equality a method of Expr?
42// #todo support non-Int types
43// #todo support multiple arguments.
44// #todo helper function or macro for arithmetic operations!
45
46// #todo primitives, builtins
47// #todo cannot be implemented with Expr::ForeignFunc as the args are pre-evaluated.
48
49// #insight special-form != primitive ? special form requires special case in the interpreter?
50
51// #todo consider removing the `std` prefix from module paths, like haskell.
52// #todo find a better prefix than setup_
53// #todo use Rc/Arc consistently
54// #todo some helpers are needed here, to streamline the code.
55
56// #todo only setup non-prelude libs on demand!pub mod http_server;
57
58// #todo call the foreign setup from the actual tan module file.
59
60pub fn import_lib(context: &mut Context) {
61 import_lib_process(context);
62 import_lib_math(context);
63 import_lib_path(context);
64 import_lib_set(context);
65 import_lib_dec(context);
66 import_lib_prelude(context);
67}