aboutsummaryrefslogtreecommitdiff
path: root/crates/sloth_vm/src/sloth_std/mod.rs
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-07 03:28:40 -0500
committerCody <cody@codyq.dev>2023-06-07 03:28:40 -0500
commit6f6613419f1511c5637c9f69b3caa5ae838270b9 (patch)
treee203d6cdc0eb2140ae6f0a430e76f2992de66bec /crates/sloth_vm/src/sloth_std/mod.rs
parent25c5ccb29a6f2387a04bfb5d50874e00084c15d6 (diff)
downloadsloth-6f6613419f1511c5637c9f69b3caa5ae838270b9.tar.gz
Moving over from a VM interpreter to natively compiled w/ LLVM
Diffstat (limited to 'crates/sloth_vm/src/sloth_std/mod.rs')
-rw-r--r--crates/sloth_vm/src/sloth_std/mod.rs43
1 files changed, 0 insertions, 43 deletions
diff --git a/crates/sloth_vm/src/sloth_std/mod.rs b/crates/sloth_vm/src/sloth_std/mod.rs
deleted file mode 100644
index ff761a6..0000000
--- a/crates/sloth_vm/src/sloth_std/mod.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-use std::collections::HashMap;
-
-use once_cell::sync::Lazy;
-
-use crate::native::NativeFunction;
-
-pub mod file;
-pub mod misc;
-pub mod rand;
-pub mod stdio;
-pub mod term;
-pub mod time;
-
-pub static NATIVE_LIBRARY: Lazy<HashMap<&'static str, NativeFunction>> = Lazy::new(|| {
- let mut map = HashMap::new();
-
- // rand
- map.insert("rand$gen", rand::GEN_FUNCTION);
- map.insert("rand$gen_range", rand::GEN_RANGE_FUNCTION);
-
- // stdio
- map.insert("write", stdio::WRITE_FUNCTION);
- map.insert("writeln", stdio::WRITELN_FUNCTION);
- map.insert("read", stdio::READ_FUNCTION);
-
- // term
- map.insert("term$clear", term::TERM_CLEAR);
- map.insert("term$setpos", term::TERM_SETPOS);
-
- // filesystem
- // TODO: Make the files commands work by making a global file variable with
- // certain permissions created by 'file.open' instead of just reading the file.
- map.insert("file$read", file::FILE_READ);
- map.insert("file$write", file::FILE_WRITE);
-
- // time
- map.insert("wait", time::WAIT);
-
- // doc
- map.insert("docs", misc::DOCS);
-
- map
-});