about summary refs log tree commit diff
path: root/pkg/lang/modules/core/core.lang
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/lang/modules/core/core.lang')
-rw-r--r--pkg/lang/modules/core/core.lang78
1 files changed, 78 insertions, 0 deletions
diff --git a/pkg/lang/modules/core/core.lang b/pkg/lang/modules/core/core.lang
new file mode 100644
index 0000000..e6be2d5
--- /dev/null
+++ b/pkg/lang/modules/core/core.lang
@@ -0,0 +1,78 @@
+type Type {
+}
+
+native(":core:setup_type", Type)
+global Type
+
+type Null {
+    () {
+        native(":core:Null:$init")
+    }
+}
+
+type Int {
+    () {
+        native(":core:Int:$init")
+    }
+}
+
+type Float {
+    () {
+        native(":core:Float:$init")
+    }
+}
+
+type String {
+    () {
+        native(":core:String:$init")
+    }
+}
+
+type Bool {
+    () {
+        native(":core:Bool:$init")
+    }
+}
+
+type Array {
+    () {
+        native(":core:Array:$init")
+    }
+
+    fn push(this, element) {
+        native(":core:Array:push", this, element)
+    }
+
+    fn pop(this) {
+        return native(":core:Array:pop", this)
+    }
+
+    fn length(this) {
+        return native(":core:Array:length", this)
+    }
+}
+
+type Function {
+    () {
+        native(":core:Function:$init")
+    }
+}
+
+fn say(message) {
+    native(":core:say", message)
+}
+
+fn ping() {
+    return "Pong!"
+}
+
+global Null
+global Int
+global Float
+global String
+global Bool
+global Array
+global Function
+
+global say
+global ping
\ No newline at end of file