summaryrefslogtreecommitdiff
path: root/pit/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'pit/src/main.c')
-rw-r--r--pit/src/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/pit/src/main.c b/pit/src/main.c
new file mode 100644
index 0000000..157ad87
--- /dev/null
+++ b/pit/src/main.c
@@ -0,0 +1,24 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+#include <lcq/pit/utils.h>
+#include <lcq/pit/lexer.h>
+#include <lcq/pit/parser.h>
+#include <lcq/pit/runtime.h>
+#include <lcq/pit/library.h>
+
+int main(int argc, char **argv) {
+ i64 sz = 256 * 1024 * 1024;
+ u8 *buf = malloc((size_t) sz);
+ pit_runtime *rt = pit_runtime_new(buf, sz);
+ pit_install_library_essential(rt);
+ pit_install_library_io(rt);
+ pit_install_library_plist(rt);
+ pit_install_library_alist(rt);
+ pit_install_library_bytestring(rt);
+ if (argc < 2) {
+ pit_repl(rt);
+ } else {
+ pit_load_file(rt, argv[1]);
+ }
+}