Akari: Dynamic & Weakly Typed Programming Powered by Rust
Core Components
| Component | Feature Flag | Description |
|---|---|---|
| Akari Value | dynamic & object_macro |
JSON implementation with macros and file I/O |
| Extensions | extension |
Type/string-based storage for middleware/app logic |
| Templating | template |
HTML template engine with inheritance and caching |
1. Akari Value (JSON)
Key Features:
// Create objects
use object;
let data = object!;
// Parse/emit JSON
let obj = from_json?;
obj.into_jsonf?; // Write to file
Important Methods:
to_string(): Debug representationstring(): Extract string valueinto_json(): Serialize to JSON stringis_dict()/is_list(): Type checks
Enable
object_macrofeature forobject!syntax
2. Extensions System
Type-Based Storage (Params):
let mut params = new;
params.set; // Store by type
params..map;
String-Based Storage (Locals):
let mut locals = new;
locals.set; // Store by key
locals.keys; // ["counter"]
Cloneable Variants:
ParamsClone: Cloneable type storageLocalsClone: Cloneable key-value storage- Methods:
combine()(no overwrite),merge()(overwrite)
Bridge Storage Types:
locals.export_param;
3. Templating Engine
Render Templates:
Key Features:
- Template inheritance with
insert - File-based template caching
- Logic control structures
See Hotaru Examples for usage patterns
Development & Contribution
Style Guidelines:
Refer to STYLE.md for coding standards
Update Log Highlights:
| Version | Key Changes |
|---|---|
| 0.2.7 | ValueParser trait redesign with streaming support (final 0.2.x) |
| 0.2.6 | Documentation updates, full features enabled |
| 0.2.5 | Safer into_json, operator implementations |
| 0.2.4 | Added is_<type>() and contains() methods |
| 0.2.3 | Renamed types, separated value/template modules |
| 0.2.2 | Template caching, insert keyword support |
| 0.1.3 | Critical empty HTML rendering fix |
Full changelog available in source documentation
Security Note: Always validate untrusted JSON input and template variables in production environments.