Overview
dart_eval is a Dart bytecode compiler and interpreter implemented entirely in Dart, designed to enable dynamic code execution and hot code updates in AOT-compiled Dart applications. It allows developers to run Dart code at runtime, supporting features like code push and plugin-like extensibility without requiring full app rebuilds. The package is compatible across multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it ideal for apps needing runtime flexibility. Its lightweight design and pure Dart implementation ensure seamless integration with existing Flutter and Dart projects.
Use cases
- Dynamic code execution in production apps
- Code push for live updates
- Extensible plugin systems
- Runtime evaluation of user-defined scripts
- Testing and prototyping with dynamic Dart code
- Building modular application architectures
Key features
- Pure Dart implementation
- Supports AOT and JIT-style execution
- Cross-platform compatibility
- Bytecode compilation and interpretation
- Lightweight and embeddable
- Enables code push functionality
Suitable for
- Developers building apps requiring runtime code execution
- Teams implementing dynamic feature delivery
- Applications needing plugin or script extensibility
- Projects exploring live code update capabilities
- Engineers working on modular or extensible architectures
Considerations
- Potential security risks with untrusted code execution
- Increased app size due to included interpreter
- Performance overhead compared to native AOT execution
- Requires careful handling of sandboxing and isolation
- Not recommended for high-frequency critical operations
- Limited debugging support in interpreted mode