3 ms·
Common Lisp's foreign function interface (either implementation specific or cross-platform a la CFFI) allows for the explicit definition of how a foreign struct
by adrianm 11y ago
Common Lisp's foreign function interface (either implementation specific or cross-platform a la CFFI) allows for the explicit definition of how a foreign structure should be laid out in memory.
Even if I'm not using Lisp for the end product, whose SLA may not permit a runtime with garbage collection, I always find it invaluable to define low-level structures with a Lisp whose machine code compiler is available at runtime for experimental interactive development.
A free and open source Lisp that you might enjoy experimenting with is SBCL, available from http://www.sbcl.org http://www.sbcl.org.
Load up the REPL, and follow the manual available here http://sbcl.org/manual/index.html#Foreign-Function-Interface http://sbcl.org/manual/index.html#Foreign-Function-Interface.
SBCL also allows you to interactively augment the machine code compiler, install new intrinsics, and disassemble any function interactively.
Even if you never use it for production code directly, it might become an invaluable tool in your low level development process.