dart_cpp_bridge 0.1.0-dev.2
dart_cpp_bridge: ^0.1.0-dev.2 copied to clipboard
Experimental Dart ↔ C++20 bridge (FRB-like). Dart FFI session layer; native library built from the monorepo (hooks not ready).
dart_cpp_bridge #
Dart-facing package for an experimental Dart ↔ C++20 bridge (FRB-like).
Dev / early preview (
0.1.0-dev.2). Native library is not built by this package yet (no build hooks). You must compile the C++ dynamic library yourself from the monorepo.
See also example/example.dart.
Full documentation #
This package is developed inside a monorepo. Do not maintain a second long README here — use the repo docs:
| English | README.md |
| 中文 | README.zh-CN.md |
| Design / progress | docs/ |
| Issues | github.com/deretame/dart_cpp_bridge |
What this package is #
- Dart FFI bindings + session / Completer / Stream / DartFn plumbing
- Companion to the C++ runtime in the same repo (
include/,src/) - Requires Dart ≥ 3.10
Minimal usage #
import 'package:dart_cpp_bridge/dart_cpp_bridge.dart';
Future<void> main() async {
final b = await DartCppBridge.init(
libraryPath: 'path/to/dart_cpp_bridge.dll', // .so / .dylib on other OS
);
print(b.bridgeVersion());
print(await b.add(40, 2));
b.shutdown(); // main isolate only, on process exit
}
Build the native library from the repo root (CMake + C++20); see the main README.
License #
MIT — see LICENSE.