This document summarizes the three renderer execution paths that currently exist in bisql and clarifies which layers are shared and which are platform- specific.
bisql currently has three execution paths:
eval-driven compilationThey are intentionally not three unrelated implementations. The design goal is to share the parsing and planning layers as much as possible and only diverge at the final execution stage.
The current compiler/runtime layering is:
More concretely:
analyze-template
extracts declaration metadata and strips declaration blocksparse-template
builds the parsed-template treerenderer-plan
converts parsed-template into an execution-oriented planemit-renderer-form
generates CLJ renderer code from the planevaluate-renderer-plan
interprets the same plan directly| Processing stage | Macro path | Runtime eval path | Interpreter path (CLJ) | Interpreter path (CLJS) |
|---|---|---|---|---|
| Raw Template input | ✓ | ✓ | ✓ | ✓ |
Declaration analysis (analyze-template) | ✓ | ✓ | ✓ | ✓ |
Parsing (parse-template) | ✓ | ✓ | ✓ | ✓ |
Execution planning (renderer-plan) | ✓ | ✓ | ✓ | ✓ |
| Final execution strategy | code generation | code generation | interpretation | interpretation |
Renderer code generation (emit-renderer-form) | ✓ | ✓ | - | - |
Compilation to executable renderer (compile-renderer) | macro expansion + Clojure compiler | eval | interpreter-backed fn | interpreter-backed fn |
Direct plan execution (evaluate-renderer-plan) | - | - | ✓ | ✓ |
| Final rendering API | render-compiled-query | render-compiled-query | render-query / interpreter-backed renderer | render-query / interpreter-backed renderer |
| Main use today | defrender, defquery | low-level runtime compilation on CLJ | parity tests / shared semantics on CLJ | browser / playground path |
Read this table top to bottom:
renderer-plan.This is the main path today.
Flow:
load-query / load-queriesanalyze-templateparse-templaterenderer-planemit-renderer-formProperties:
evalThis is the low-level runtime compilation path.
Flow:
analyze-templateparse-templaterenderer-planemit-renderer-formcompile-rendererevalProperties:
This is the platform-neutral execution path and is the foundation for CLJS and browser usage.
Flow:
analyze-templateparse-templaterenderer-planevaluate-renderer-planOn CLJS, compile-renderer now returns a reusable function backed by this
interpreter.
Properties:
evalThe important current sharing boundary is:
raw template
-> analyze-template
-> parse-template
-> renderer-plan
After that point, execution splits:
emit-renderer-formevalevaluate-renderer-planThis means the parser and the execution-oriented plan are shared, while the final execution strategy differs by environment.
Even after introducing renderer-plan, there is still some drift risk.
Potential drift points:
emit-renderer-form and evaluate-renderer-plan may interpret the same step
differentlyCurrent mitigation:
render-queryrender-queryThe current status is:
This is not complete unification, but it is no longer three unrelated paths. The shared contract is now explicit and testable.
Likely future work:
bisql.engine/render-queryCan you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |