Hacker News new | ask | show | jobs
by petra 3675 days ago
>> "Microscheme has a robust FFI (Foreign Function Interface) meaning that C code may be invoked directly from (ms) programs. Therefore, the power of the existing wealth of Arduino libraries is available within Microscheme. "

Arduino is c++, and c++ FFI's are really hard. So how does this FFI work ?

1 comments

According to a quick look through the documentation, C code is called though a simple interface: (call-c-func "c-function-name" args …). OTOH it didn't appear that it's possible to call Scheme from C, which may be a disadvantage in some cases.

You are right, no mention of C++. It's not clear how much of a problem that would be. IIRC wrapping C++ in "extern C" more or less enables C++ functions to be called from C. Don't know about compatibility of Arduino libraries, but possibly this is how Microscheme FFI works.