while loop support, and native functions (including ffi!)

This commit is contained in:
2023-09-06 19:07:28 -07:00
parent ddff6cb365
commit 236f812caf
34 changed files with 467 additions and 115 deletions

13
examples/ffi.pork Normal file
View File

@ -0,0 +1,13 @@
func malloc(size)
native ffi "libc.dylib:malloc:void*"
func free(pointer)
native ffi "libc.dylib:free:void"
export func main() {
while true {
let pointer = malloc(8192)
println(pointer)
free(pointer)
}
}