Docs / Considerations
17. Limitations & Performance Trade-offs
Dryad is designed for scripting, automation, prototyping, and small-to-medium applications. It is not intended for computationally intensive workloads, hard real-time systems, or performance-critical production pipelines — at least not until the AOT compiler matures. Below are the current known limitations and design trade-offs.
| Limitation | Impact | Mitigation / Future Work |
|---|---|---|
| Interpreter speed | Slower than compiled languages for CPU-heavy work | Use bytecode VM (set_compile_mode(true)) or AOT compilation. |
| Dynamic typing | No compile-time type error detection | Opt-in 'use strict types' mode enables static validation in AOT. |
| FFI complexity | Complex types passed as opaque pointers | Stick to primitives across the FFI boundary; wrappers in Dryad. |
| Single-threaded interpreter | Base interpreter runs on one thread | thread functions run on real OS threads; they are isolated. |
| Module versioning | No built-in package manager yet | Manual path management; package manager is on the roadmap. |
| AOT experimental | Not all language features supported | Use interpreter/bytecode for development; AOT for stable hot paths. |
| Deep call stacks | Stack overflow risk with unbounded recursion | Prefer iterative patterns; set explicit recursion limits. |
| Frequent GC pressure | Large array operations trigger collections | Use buffers for raw data; minimize object allocations in loops. |
When Not to Use Dryad (Current State)
1 // ❌ Heavy numeric computation (prefer AOT or native code) 2 // Fibonacci(40) in the AST interpreter is ~10x slower than native 3 function fib(n) { 4 if (n <= 1) return n; 5 return fib(n - 1) + fib(n - 2); // deep recursion is slow 6 } 7 8 // ✅ Automation and orchestration (where Dryad shines) 9 #io 10 function deploy() { 11 let config = io_read_file("deploy.json"); 12 let result = run_health_checks(config); 13 io_write_file("status.log", result); 14 } 15 16 // ✅ Rapid prototyping with FFI 17 #math 18 let result = #math::clamp(value, 0, 100);
Use the AST interpreter for scripting and prototyping. Switch to bytecode mode for better performance. Reserve AOT for production builds when the backend stabilizes.
Found an error in the spec? Open a PR.
Official Version: 1.0 · May 2026