Zorro Plugin 2021 -
plugin("myplugin.dll"); // load plugin int result = plugin_call("myFunction", 3.14, 2.71); // call exported function printf("Result: %f", result);
gcc -shared -o myplugin.dll minimal_plugin.c Use in Zorro:
return plugin_call("sentiment", (double)string_to_ptr(ticker)); zorro plugin
plugin("myplugin.dll"); print(plugin_call("add", 5, 3)); // prints 8.000000
// Called once when Zorro loads the plugin int PLUGIN_INIT(void) // Initialize resources, load ML models, etc. return 0; // 0 = success, non-zero = error plugin("myplugin
// Custom user function callable from S-Lang double PLUGIN_CALL(char* name, double* params, int nParams) if(strcmp(name, "myFunction") == 0) return myFunction(params[0], params[1]); return -1; // error
| Method | Latency (mean) | Throughput (calls/sec) | Memory overhead | |--------|----------------|------------------------|------------------| | Native S-Lang function | 0.2 µs | 5,000,000 | 0 MB | | Plugin (simple math) | 1.5 µs | 660,000 | 1.2 MB | | Plugin (sentiment with cache) | 8.2 ms | 122 | 45 MB | | External Python via socket | 23 ms | 43 | 210 MB | // call exported function printf("Result: %f"
Zorro Plugin: Architecture, Implementation, and Application in Algorithmic Trading Systems
