From FPL to a native ABI module
Documentation status: guide. The method is source-described; use the public ABI reference for the actual supported marshalling subset.
Why the bridge exists
FPL/functionalP can implement executable behavior inside a model. When that behavior must call a versioned native module, the runtime can link a resolved FPL call to an ABI method descriptor and execute it through the native boundary. This is not a replacement for ordinary Pascal function calls.
FPL source -> parser/AST -> ABI linker -> method descriptor
-> execution bridge -> ABI executor -> native module
Integration sequence
- Load the ABI manifest. The compilation registry resolves methods with module/type/method identity, call kind and physical parameter/result layout. Target pointer size and other assumptions must match.
- Register the native module. Use a unique non-zero module identifier. The documented
TABINativeModuleloader is Windows-specific at the recorded source version, so do not assume portable native module loading. - Configure linker and executor. The linker identifies calls, the executor packs the declared arguments, and the bridge converts between FPL runtime values and ABI values.
- Run while configuration is valid. Manage registry/executor lifetime; release native-owned handles and error buffers through their specified mechanisms.
- Test failures as well as success. Exercise incompatible manifests, unknown module ids, invalid receivers, unsupported parameter kinds and ownership release.
Avoid conflating three scopes
FPL language syntax, ABI descriptor vocabulary and the execution bridge actually tested are not the same thing. In particular, the public reference distinguishes implemented i32, pointer and handle paths from wider or partial descriptor vocabulary such as out/inout and some array/callback forms.
Read next
functionalP essentials · FPL–ABI bridge · Manifest · Ownership and release
LaTeX sources: native-abi-and-fpl-native-modules.tex; fpl-language-essentials.tex; running-fpl-from-radstudio-code.tex.