Hi,
I recently learned Rust and want to re-write my old custom nodes using Rust. I know that Rust compiler can output LLVM bitcode and I believe I could investigate more on that topic but I’d need a little help with some Vuo-specific requirement for the output bitcode:
- what LLVM bitcode symbols should be exposed?
- what should be the names of them?
- which parts of the attached *.c source code are needed by Vuo to open & use a custom node?
EDIT: I managed to compile example node in Rust to bitcode with exported symbols just to mimic some SDK example node bitcode, with these symbols exported:
---------------- T _VuoLog_initModuleName
---------------- D _VuoLog_moduleName
---------------- D _dumski_rust_simple__moduleDetails
---------------- T _dumski_rust_simple__nodeEvent
But trying to install this bitcode in Vuo results with this error:
readModuleFromFile():1759 Error: Couldn't load module 'dumski.rust.simple' into arm64 environment: Couldn't parse bitcode file: Invalid record.
… and no further info. Native Vuo nodes have these symbols exposed:
---------------- t _VuoLog_initModuleName
---------------- d _VuoLog_moduleName
---------------- t _VuoPoint2d_distance # this is output port
w _basename_r
U _dladdr
U _malloc
U _sqrtf
U _strlen
U _strncmp
U _strrchr
---------------- D _vuo_point_distance__moduleDetails
---------------- T _vuo_point_distance__nodeEvent # this is input port
Which ones are mandatory to export from custom node? Or maybe there’s somthing else I should export to allow Vuo accept my bitcode?
Cheers, Teo