dart_monty_ffi 0.6.0
dart_monty_ffi: ^0.6.0 copied to clipboard
Native FFI backend for dart_monty, pure Dart bindings for Monty — a restricted sandboxed Python interpreter built in Rust.
dart_monty_ffi #
Part of dart_monty — pure Dart bindings for Monty, a restricted, sandboxed Python interpreter built in Rust.
Pure Dart native FFI implementation of dart_monty. Wraps the Rust libdart_monty_native shared library via dart:ffi, providing synchronous bindings to the Monty sandboxed Python interpreter.
This package has no Flutter dependency and can be used in CLI tools, server-side Dart, or any Dart project.
- Flutter apps should import
dart_montyinstead — the federated plugin selects the correct backend automatically. - Pure Dart projects (CLI, server) can depend on this package directly to run Python via the native Rust library.
Architecture #
Dart -> NativeBindingsFfi (dart:ffi)
-> DynamicLibrary.open(libdart_monty_native)
-> 17 extern "C" functions (Rust)
Key Classes #
| Class | Description |
|---|---|
NativeBindings |
Abstract interface over the 17 native C functions |
NativeBindingsFfi |
Concrete FFI implementation with pointer lifecycle management |
MontyFfi |
MontyPlatform implementation using NativeBindings |
NativeLibraryLoader |
Platform-aware library path resolution |
See the main dart_monty repository for full documentation.