Open Rewbert opened 2 years ago
FFI in the EDSL seems like a good use case for quasiquote C library, at least for the C backend. We can use it to embed verbatim C, in the same way that inline assembly allows C programmers to embed platform-specific inline assembly.
What e.g
output 1
does is to record the information that output pin1
has been requested, and to create a reference that can be used to write to the output handler. The call returns this reference along with this output handler, that has to beschedule
d in order to actualize the output. The output handler is hand-written by us right now and is just expected to exist.We have a lot of functionality in the compiler to perhaps hack together a better interface for doing this, where most of the stuff is done in scoria. We do need some FFI, however.