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.

LimitationImpactMitigation / Future Work
Interpreter speedSlower than compiled languages for CPU-heavy workUse bytecode VM (set_compile_mode(true)) or AOT compilation.
Dynamic typingNo compile-time type error detectionOpt-in 'use strict types' mode enables static validation in AOT.
FFI complexityComplex types passed as opaque pointersStick to primitives across the FFI boundary; wrappers in Dryad.
Single-threaded interpreterBase interpreter runs on one threadthread functions run on real OS threads; they are isolated.
Module versioningNo built-in package manager yetManual path management; package manager is on the roadmap.
AOT experimentalNot all language features supportedUse interpreter/bytecode for development; AOT for stable hot paths.
Deep call stacksStack overflow risk with unbounded recursionPrefer iterative patterns; set explicit recursion limits.
Frequent GC pressureLarge array operations trigger collectionsUse 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