3 ms·
That's the idea yes. Since an example is worth a thousand words, here is a function for the http module, counting argument, checking the types and then using t
by jackrabbit_ 7y ago
That's the idea yes.
Since an example is worth a thousand words, here is a function for the http module, counting argument, checking the types and then using the values to create an http client (to make http requests to web servers): https://github.com/ArkScript-lang/modules/blob/refactoring/http/src/client.cpp#L72 https://github.com/ArkScript-lang/modules/blob/refactoring/h...
- eatonphil 7y agoThat's not exactly an FFI, that's an extension since you're coding against ArkScript's C++ API. An FFI is when you use only ArkScript to make calls against other languages that don't know about ArkScript's API.
- saagarjha 7y agoThe wiki (https://github.com/ArkScript-lang/Ark/wiki/Embedding#creating-plugins https://github.com/ArkScript-lang/Ark/wiki/Embedding#creatin...) calls them “plugins” and they’re also called “modules”, which I think is a lot clearer than “FFI”. Essentially it’s a bunch of native functions that are exported with C linkage and compiled into a set of shared libraries, which are then loaded and the functions in them looked up at runtime. On the other (C++) side it’s similar to e.g. a JNI binding or any other language where you can pull values out of the runtime.
- jackrabbit_ 7y ago> An FFI is when you use only ArkScript to make calls against other languages that don't know about ArkScript's API I should definitly rename this part as stated in another comment, since the "FFI" isn't a real one, I messed up with the vocabulary
- ngold 7y agoSuper fun. This is a great project.
- jackrabbit_ 7y agoThanks!