smartgpt
smartgpt copied to clipboard
Plugin Loading System via LLVM integration
It is possible to create a cross-platform dynamic library using LLVM that can be imported by Rust on various systems. LLVM, a collection of modular and reusable compiler and toolchain technologies, generates an intermediate representation (IR) code that provides a certain level of abstraction from the platform. Rust has the capability to link against these dynamically generated libraries.
However, creating such a library involves dealing with some complexities:
-
Cross-platform development requires handling specific aspects tailored to different platforms in your codebase while maintaining general compatibility across all target platforms.
-
Addressing ABI (Application Binary Interface) compatibility issues between languages when linking together compiled components may require extra consideration during implementation stages.
-
Configuring build scripts are essential for ensuring correct compilation results, and it'd be frustrating with a lot of boilerplate for every plugin made.
I've pinned this, as some form of dynamic plugin system (as in, dynamically loaded, not dynamically typed) is important to SmartGPT in the future, and this proposes one way to do it. I've renamed the issue, though, to highlight that focus.