feat: implement M1 Ferro frontend

This commit is contained in:
2026-08-16 07:10:53 +09:00
parent 990068f424
commit 005056a5ea
32 changed files with 986 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
unit core;
pub error Error { Invalid = 1, Io = 2, }
pub fn panic(msg: str, file: str, line: u32) { }
pub fn assert(ok: bool) { }
+4
View File
@@ -0,0 +1,4 @@
unit fmt;
pub fn write_str(w: &mut io.Writer, s: str) -> !void;
pub fn write_int_i32(w: &mut io.Writer, v: i32) -> !void;
pub fn write_bool(w: &mut io.Writer, v: bool) -> !void;
+9
View File
@@ -0,0 +1,9 @@
unit io;
pub struct Writer {
ctx: *void,
write_fn: fn(*void, []u8) -> !usize,
}
pub struct File {
handle: u16,
pub fn close(self: &mut Self) { }
}
+6
View File
@@ -0,0 +1,6 @@
unit list;
pub struct List(T) {
items: ^[]T,
len: usize,
pub fn at(self: &Self, i: usize) -> &T;
}
+4
View File
@@ -0,0 +1,4 @@
unit map;
pub struct Map(K, V) {
len: usize,
}
+11
View File
@@ -0,0 +1,11 @@
unit mem;
pub fn create(T: type) -> !^T;
pub fn destroy(p: *void);
pub fn copy(dst: []u8, src: []u8);
pub struct Arena {
ptr: *void,
pub fn init() -> Arena { return Arena{ ptr: null }; }
pub fn reset(self: &mut Self) { }
pub fn drop(self: &mut Self) { }
}
+3
View File
@@ -0,0 +1,3 @@
unit str;
pub fn eq(a: str, b: str) -> bool;
pub fn trim(s: str) -> str;
+2
View File
@@ -0,0 +1,2 @@
unit sys;
pub fn exit(code: u16);