From 26f15d29429a0afd066356158478b29fa0b98dc2 Mon Sep 17 00:00:00 2001 From: Hassan Abedi Date: Mon, 30 Mar 2026 11:03:42 +0200 Subject: [PATCH] WIP --- scratches/query-engine-broad.svg | 266 +++++++++++++++++++++++ scratches/query-engine-narrow.svg | 342 ++++++++++++++++++++++++++++++ 2 files changed, 608 insertions(+) create mode 100644 scratches/query-engine-broad.svg create mode 100644 scratches/query-engine-narrow.svg diff --git a/scratches/query-engine-broad.svg b/scratches/query-engine-broad.svg new file mode 100644 index 0000000..48136f0 --- /dev/null +++ b/scratches/query-engine-broad.svg @@ -0,0 +1,266 @@ + + + + + + +GeologQueryEngineBroad + + +cluster_frontend + +Geolog Front End + + +cluster_language + +Language Pipeline + + +cluster_tools + +Developer Tooling + + +cluster_runtime + +Shared Runtime / Execution Layer + + +cluster_engine + +IR Execution Engine + + +cluster_adapters + +Backend Adapters + + +cluster_backends + +Execution Targets + + + +concrete + +Concrete Syntax + + + +parser + +Parser + + + +concrete->parser + + + + + +abstract + +Abstract Syntax + + + +parser->abstract + + + + + +lsp + +LSP +(parsing + elaboration diagnostics) + + + +parser->lsp + + +syntax info + + + +elaborator + +Elaborator + + + +abstract->elaborator + + + + + +typed + +Elaborated Syntax +(with types) + + + +elaborator->typed + + + + + +elaborator->lsp + + +type info + + + +lowering + +Lowering + + + +typed->lowering + + + + + +ir + +Intermediate Representation +(shared execution contract) + + + +lowering->ir + + + + + +engine + +Shared Query Engine +• user queries +• law checking +• chase / fixpoint steps +• planning / rewriting + + + +ir->engine + + +execute IR + + + +runtime_ir + +Runtime State +(branches, witnesses, +equality, provenance) + + + +engine->runtime_ir + + +maintains + + + +inmem_adapter + +In-Memory Adapter + + + +engine->inmem_adapter + + + + + +pg_adapter + +Postgres Adapter + + + +engine->pg_adapter + + + + + +ffi + +FFI Haskell to Rust +(IR marshalling) + + + +engine->ffi + + + + + +inmem_db + +In-Memory DB + + + +inmem_adapter->inmem_db + + + + + +pg_db + +Postgres DB + + + +pg_adapter->pg_db + + + + + +rust_adapter + +Rust Adapter + + + +rust_store + +Rust Storage / Query Layer + + + +rust_adapter->rust_store + + + + + +ffi->rust_adapter + + + + + diff --git a/scratches/query-engine-narrow.svg b/scratches/query-engine-narrow.svg new file mode 100644 index 0000000..bf59e9e --- /dev/null +++ b/scratches/query-engine-narrow.svg @@ -0,0 +1,342 @@ + + + + + + +GeologQueryEngineNarrow + + +cluster_frontend + +Geolog Front End + + +cluster_language + +Language Pipeline + + +cluster_tools + +Developer Tooling + + +cluster_execution + +Execution Layer + + +cluster_backends + +Backend Implementations + + +cluster_inmemory + +In-Memory Backend + + +cluster_postgres + +Postgres Backend + + +cluster_rust + +Rust Backend + + + +concrete + +Concrete Syntax + + + +parser + +Parser + + + +concrete->parser + + + + + +abstract + +Abstract Syntax + + + +parser->abstract + + + + + +lsp + +LSP +(parsing + elaboration diagnostics) + + + +parser->lsp + + +syntax info + + + +elaborator + +Elaborator + + + +abstract->elaborator + + + + + +typed + +Elaborated Syntax +(with types) + + + +elaborator->typed + + + + + +elaborator->lsp + + +type info + + + +lowering + +Lowering + + + +typed->lowering + + + + + +ir + +Intermediate Representation +(backend-neutral contract) + + + +lowering->ir + + + + + +query_translation + +IR to Backend Translation + + + +ir->query_translation + + +compile IR + + + +inmem_rel + +Relation Translation + + + +query_translation->inmem_rel + + + + + +inmem_laws + +Law / Chase Translation + + + +query_translation->inmem_laws + + + + + +pg_schema + +IR to Schema + + + +query_translation->pg_schema + + + + + +pg_queries + +IR to SQL Queries + + + +query_translation->pg_queries + + + + + +ffi + +FFI Haskell to Rust +(IR marshalling) + + + +query_translation->ffi + + + + + +inmem_qe + +In-Memory Query Engine + + + +inmem_rel->inmem_qe + + + + + +inmem_laws->inmem_qe + + + + + +inmem_db + +In-Memory DB + + + +inmem_qe->inmem_db + + + + + +pg_db + +Postgres DB + + + +pg_schema->pg_db + + + + + +pg_qe + +Postgres Query Engine + + + +pg_queries->pg_qe + + + + + +pg_qe->pg_db + + + + + +rust_rel + +Relation Translation + + + +ffi->rust_rel + + + + + +rust_laws + +Law / Chase Translation + + + +ffi->rust_laws + + + + + +rust_qe + +Rust Query Engine + + + +rust_rel->rust_qe + + + + + +rust_laws->rust_qe + + + + + +rust_store + +Rust Storage / Query Layer + + + +rust_qe->rust_store + + + + +