nibi-lang / nibi

An interpreted list processing language inspired by Lisp
GNU Affero General Public License v3.0
3 stars 2 forks source link

Functionality: ffi struct definitions #127

Open bosley opened 1 year ago

bosley commented 1 year ago

ffi support right now can do basic types. if we want structs, we will need a way to "define" the structs in such a way that we can generate an ffi representation of the struct, and maybe do some basic things like initing a pointer of the type, etc.

This is a cool way that some languages do this: https://github.com/rpav/c2ffi

We could use that, or we could come up with some.. other way. toml/json representation or something.

bosley commented 1 year ago

http://www.chiark.greenend.org.uk/doc/libffi-dev/html/Type-Example.html

bosley commented 1 year ago

Consider if we should have an ffi module that allows more than just primitive types to be mucked with. I think extern-call and how we handle primitives should stay around for basic integration, but something more encompassing should be done.

If not that, then we need to be able to dynamically make/remove ctypes when we make structs and whatnot.