hetu_script
0.8.0, released 2 weeks ago by hetu.dev
A lightweight Dart scripting language for embedding in Flutter apps
WASM-ready
What it does
Hetu Script lets you write and execute scripts at runtime, exposing JavaScript‑friendly APIs and allowing Dart functions to be called from script and vice versa.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need hot‑fix or runtime scripting in a Flutter app
- You want to expose Dart logic to a scriptable UI or game
- You prefer a JavaScript‑like syntax for scripting
Skip it when
- You need a full‑blown state‑management or dependency‑injection framework
- You require extensive third‑party integrations beyond scripting
Strengths
- Runs on all Flutter platforms, including web and desktop
- JavaScript‑friendly standard library makes it easy for JS developers
- Easy binding: call Dart functions from script with one line
- Supports async/await and modern language features
Weaknesses
- No built‑in state‑management or UI widgets
- Limited ecosystem compared to mainstream packages
- Requires manual setup of bindings for Dart functions
- Documentation is primarily in English, Chinese available
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 7
Add dependency, create Hetu instance, call init(), then eval() or use externalFunctions map
import 'package:hetu_script/hetu_script.dart';
void main(){
final hetu = Hetu();
hetu.init();
hetu.eval(r'''var ht={name:'Hetu',greeting:()=>print('Hello $name!')} ; ht.greeting();''');
}Works with
Packages commonly used together with hetu_script: ones it builds on, ones built on it, and its own family.
- pub_semverhetu_script depends on itVersions and version constraints implementing pub's versioning policy.
- charactershetu_script depends on itUnicode and grapheme cluster aware string manipulation operations for Dart.
- quiverhetu_script depends on itA set of utility libraries for Dart containing collections, async tools, and testing helpers.
- recasehetu_script depends on itChanges the case of input text to various conventions.
- fast_noisehetu_script depends on itA port of fast noise algorithms including cellular, cubic, perlin, simplex, value, and white noise.