---
title: "go-go-goja — Go-Hosted JavaScript Runtimes and Generated Applications"
description: "go-go-goja — Go-Hosted JavaScript Runtimes and Generated Applications go-go-goja is the Go-side runtime and tooling ecosystem for embedding JavaScript with goja. It combines explicit runtime ownersh…"
doc_version: 1
last_updated: 2026-10-15
canonical_url: "http://parc.yolo.scapegoat.dev/note/research/kb/projects/go-go-goja"
---

# go-go-goja — Go-Hosted JavaScript Runtimes and Generated Applications

go-go-goja — Go-Hosted JavaScript Runtimes and Generated Applications go-go-goja is the Go-side runtime and tooling ecosystem for embedding JavaScript with goja. It combines explicit runtime ownersh…

## Tags

- `knowledge-base`
- `project`
- `go-go-goja`
- `goja`
- `javascript`
- `xgoja`
- `runtime`

## Content

# go-go-goja — Go-Hosted JavaScript Runtimes and Generated Applications

`go-go-goja` is the Go-side runtime and tooling ecosystem for embedding JavaScript with goja. It combines explicit runtime ownership, native modules, fluent Go-backed objects, jsverbs/Glazed command generation, xgoja compile-time provider composition, HTTP serving, storage, async boundaries, and reusable application hosts. The central design problem is not simply “run JavaScript”; it is to make JavaScript capabilities composable while keeping Go in control of lifecycle, permissions, context, scheduling, and generated-binary composition.

> [!summary]
> - **Runtime:** create and own goja runtimes with explicit context, session, thread, and async semantics.
> - **Modules and DSLs:** expose typed Go capabilities as JavaScript modules and fluent builders.
> - **xgoja:** compose providers and source graphs at build time into focused generated hosts rather than one ambient mega-runtime.

## Architecture map

```mermaid
flowchart TD
    APP[Go application] --> RUNTIME[Runtime creation and ownership]
    RUNTIME --> VM[goja VM]
    VM --> MODULES[Native modules and Go-backed objects]
    MODULES --> DSL[Fluent DSLs and jsverbs]
    DSL --> COMMANDS[Glazed commands / HTTP services / UI hosts]
    PROVIDERS[Compile-time providers] --> XGOJA[xgoja RuntimePlan]
    XGOJA --> HOST[Generated application binary]
    RUNTIME --> CONTEXT[Request, session, cancellation, async context]
    CONTEXT --> MODULES
```

The runtime is the boundary that makes the rest safe. A module should not invent its own lifecycle or reach into process-global state; it should receive the runtime/context capabilities its host intentionally provides. xgoja then makes the module set and application profile explicit at build time.

## Capability areas

### Runtime ownership and execution

- [[ARTICLE - go-go-goja Runtime System - Creation Context Scheduling and Modules]] — runtime construction, scheduling, and module ownership.
- [[ARTICLE - go-go-goja Context Management - Runtime Request and Async Call Context]] — request context and asynchronous work.
- [[Research/KB/Tribal/goja-execution-model]] — sessions, thread safety, and async invariants.
- [[PROJ - go-go-goja REPL API - Profiles, IIFE Rewriting, and AST-Driven Session Semantics]] — interactive runtime semantics.
- [[PROJ - Goja REPL Hardening]] — hardening the interactive boundary.

### Native modules and Go-backed JavaScript

- [[Research/KB/Tribal/goja-embedding-in-go]] — baseline embedding pattern.
- [[ARTICLE - Designing DSLs with go-go-goja - Go-Backed JavaScript APIs]] — fluent API design.
- [[ARTICLE - Goja Fluent-Builder DSLs - Designing Typed Composable Grammars in Go for JavaScript]] — typed composable builder grammar.
- [[ARTICLE - go-go-goja Protobuf Builders - Goja Native Fluent Proto Construction]] — structured native objects.
- [[ARTICLE - go-go-goja - Adding Transaction Support to the Goja DB Module]] — stateful module boundaries.
- [[ARTICLE - Report - Go Go Goja EventEmitter Implementation]] — event delivery.
- [[ARTICLE - Report - Go Go Goja fswatch Implementation]] — host-side filesystem events.

### xgoja and generated hosts

- [[ARTICLE - xgoja - Compile-Time Goja Module Composition and jsverbs Mounting]] — compile-time composition model.
- [[ARTICLE - xgoja - Generated Goja Applications Provider Architecture and Runtime Profiles]] — provider architecture and profiles.
- [[ARTICLE - New XGoja - Source Graphs Provider Plans and the V2 Runtime Compiler]] — source graphs and provider plans.
- [[ARTICLE - xgoja v2 RuntimePlan Hard Cutover - Technical Deep Dive]] — the hard-cut runtime-plan transition.
- [[ARTICLE - Playbook - Building go-go-goja xgoja Provider Packages]] — provider package implementation workflow.
- [[PROJ - XGoja Provider Support - Third-Party Package Rollout]] — rolling providers into existing packages.

### Applications and integrations

- [[PROJ - go-go-goja jsverbs - JavaScript to Glazed Commands]] — JavaScript-defined structured CLI commands.
- [[ARTICLE - xgoja - Building a Query Tool with Jsverbs and Embedded Modules]] — a generated query application.
- [[ARTICLE - go-go-goja - HTTP Serve Support for xgoja Generated Verbs]] — HTTP serving from generated verbs.
- [[ARTICLE - xgoja - HTTP Serve, Hot Reload, and Runtime Service Architecture]] — service lifecycle and reloads.
- [[ARTICLE - go-go-goja Express Auth - From Planned Routes to Generated Host Auth]] — route and host authentication.
- [[ARTICLE - go-go-goja Programmatic Auth After Rate Limiting - Deep Dive]] — auth ordering and route policy.
- [[ARTICLE - xgoja - Build Environments and Jsverb Command Design for Vector RAG Tools (gpt-5.5 medium)]] — RAG tool host design.

### Interpreter instrumentation and hosting platform analysis

- [[CHATGPT TRANSCRIPT - JavaScript Interpreter Instrumentation — Goja eBPF]] — proposes a jBPF-style probe runtime for goja: function-call/return hooks, invariant assertion, metrics and static analysis
- [[CHATGPT TRANSCRIPT - Hosting Platform Analysis — Goja Cloud]] — analysis of go-go-goja + go-go-host + tiny-idp for a subscription-based goja hosting platform (AWS Lambda-style with web UIs, Stripe, versioned releases)

Related output artifacts (in `Attachments/chatgpt-outputs/`):
- `secure-goja-hosting-platform-textbook.md`
- `hosted-goja-platform-textbook.md`
- `agent-native-application-cloud-founder-dossier.md`

## Recommended reading path

1. Start with the runtime-system report and the goja execution-model tribal entry.
2. Read the native-module and fluent-builder notes to understand the JavaScript API boundary.
3. Read xgoja provider and RuntimePlan reports to understand generated binaries.
4. Read one integration note such as jsverbs, HTTP serve, or Express Auth.
5. Use the application reports for concrete constraints and failure modes.

## Working rules

- Keep goja runtime ownership explicit; do not treat a runtime as a globally shareable object.
- Marshal work back to the owning runtime thread when callbacks or async results cross Go boundaries.
- Keep module capabilities narrow and host-provided.
- Use plain JSON-shaped values at stable boundaries when that improves interoperability.
- Prefer wrapper-first APIs over leaking internal Go objects directly.
- Compose providers at build time with xgoja rather than exposing every module to every binary.
- Treat generated hosts as products with their own configuration, help, assets, and release behavior.

## Related knowledge

- [[goja-text]] and [[goja-bleve]] — sibling native modules built on the same host/runtime ecosystem.
- [[researchctl]] — another Goja-backed DSL and generated-host use case.
- [[Research/KB/Tribal/data-only-vs-host-access-module-split]] — capability separation pattern.
- [[Research/KB/Tribal/dsl-normalized-config-compiled-plan]] — normalize and compile declarative input before execution.

## Repository map

Repository: `/home/manuel/code/wesen/go-go-golems/go-go-goja`

| Concern | Location |
|---|---|
| Runtime and context | runtime packages |
| Native modules | module/provider packages |
| xgoja composition | xgoja/provider packages |
| jsverbs and Glazed | jsverbs packages |
| Generated examples | `examples/` |
| Runtime and provider tests | package tests and integration fixtures |

## Wiki Links

- ARTICLE - go-go-goja Runtime System - Creation Context Scheduling and Modules
- ARTICLE - go-go-goja Context Management - Runtime Request and Async Call Context
- Research/KB/Tribal/goja-execution-model
- PROJ - go-go-goja REPL API - Profiles, IIFE Rewriting, and AST-Driven Session Semantics
- PROJ - Goja REPL Hardening
- Research/KB/Tribal/goja-embedding-in-go
- ARTICLE - Designing DSLs with go-go-goja - Go-Backed JavaScript APIs
- ARTICLE - Goja Fluent-Builder DSLs - Designing Typed Composable Grammars in Go for JavaScript
- ARTICLE - go-go-goja Protobuf Builders - Goja Native Fluent Proto Construction
- ARTICLE - go-go-goja - Adding Transaction Support to the Goja DB Module
- ARTICLE - Report - Go Go Goja EventEmitter Implementation
- ARTICLE - Report - Go Go Goja fswatch Implementation
- ARTICLE - xgoja - Compile-Time Goja Module Composition and jsverbs Mounting
- ARTICLE - xgoja - Generated Goja Applications Provider Architecture and Runtime Profiles
- ARTICLE - New XGoja - Source Graphs Provider Plans and the V2 Runtime Compiler
- ARTICLE - xgoja v2 RuntimePlan Hard Cutover - Technical Deep Dive
- ARTICLE - Playbook - Building go-go-goja xgoja Provider Packages
- PROJ - XGoja Provider Support - Third-Party Package Rollout
- PROJ - go-go-goja jsverbs - JavaScript to Glazed Commands
- ARTICLE - xgoja - Building a Query Tool with Jsverbs and Embedded Modules
- ARTICLE - go-go-goja - HTTP Serve Support for xgoja Generated Verbs
- ARTICLE - xgoja - HTTP Serve, Hot Reload, and Runtime Service Architecture
- ARTICLE - go-go-goja Express Auth - From Planned Routes to Generated Host Auth
- ARTICLE - go-go-goja Programmatic Auth After Rate Limiting - Deep Dive
- ARTICLE - xgoja - Build Environments and Jsverb Command Design for Vector RAG Tools (gpt-5.5 medium)
- CHATGPT TRANSCRIPT - JavaScript Interpreter Instrumentation — Goja eBPF
- CHATGPT TRANSCRIPT - Hosting Platform Analysis — Goja Cloud
- goja-text
- goja-bleve
- researchctl
- Research/KB/Tribal/data-only-vs-host-access-module-split
- Research/KB/Tribal/dsl-normalized-config-compiled-plan

## Backlinks

- [projects/2026/05/23/article-go-go-goja-runtime-system-creation-context-scheduling-and-modules](http://parc.yolo.scapegoat.dev/note/projects/2026/05/23/article-go-go-goja-runtime-system-creation-context-scheduling-and-modules)
- [projects/2026/06/04/article-go-go-goja-http-serve-support-for-xgoja-generated-verbs](http://parc.yolo.scapegoat.dev/note/projects/2026/06/04/article-go-go-goja-http-serve-support-for-xgoja-generated-verbs)
- [research/kb/projects/glazed](http://parc.yolo.scapegoat.dev/note/research/kb/projects/glazed)
- [research/kb/projects/goja-text](http://parc.yolo.scapegoat.dev/note/research/kb/projects/goja-text)
- [research/kb/projects/rag-evaluation-system](http://parc.yolo.scapegoat.dev/note/research/kb/projects/rag-evaluation-system)
- [projects/2026/04/03/proj-go-go-goja-repl-api-profiles-iife-rewriting-and-ast-driven-session-semantics](http://parc.yolo.scapegoat.dev/note/projects/2026/04/03/proj-go-go-goja-repl-api-profiles-iife-rewriting-and-ast-driven-session-semantics)
- [research/kb/projects/sessionstream](http://parc.yolo.scapegoat.dev/note/research/kb/projects/sessionstream)
- [projects/2026/07/18/proj-publish-vault-widget-dsl-server-driven-pages-from-an-embedded-javascript-runtime](http://parc.yolo.scapegoat.dev/note/projects/2026/07/18/proj-publish-vault-widget-dsl-server-driven-pages-from-an-embedded-javascript-runtime)
- [research/kb/fundamentals/category-theory-and-logic](http://parc.yolo.scapegoat.dev/note/research/kb/fundamentals/category-theory-and-logic)
- [research/kb/projects/infrastructure-and-release](http://parc.yolo.scapegoat.dev/note/research/kb/projects/infrastructure-and-release)
- [research/kb/projects/goja-bleve](http://parc.yolo.scapegoat.dev/note/research/kb/projects/goja-bleve)
- [research/kb/projects/geppetto](http://parc.yolo.scapegoat.dev/note/research/kb/projects/geppetto)
- [research/kb/projects/devctl](http://parc.yolo.scapegoat.dev/note/research/kb/projects/devctl)
- [projects/2026/07/19/proj-golem-docs-serving-the-go-go-golems-documentation-from-embedded-doc-trees](http://parc.yolo.scapegoat.dev/note/projects/2026/07/19/proj-golem-docs-serving-the-go-go-golems-documentation-from-embedded-doc-trees)
- [projects/2026/05/15/article-go-go-goja-context-management-runtime-request-and-async-call-context](http://parc.yolo.scapegoat.dev/note/projects/2026/05/15/article-go-go-goja-context-management-runtime-request-and-async-call-context)
- [projects/2026/06/12/article-go-go-goja-express-auth-go-backed-fluent-route-plans](http://parc.yolo.scapegoat.dev/note/projects/2026/06/12/article-go-go-goja-express-auth-go-backed-fluent-route-plans)
- [projects/2026/07/18/proj-go-go-wm-scripting-a-window-manager-with-an-embedded-javascript-runtime](http://parc.yolo.scapegoat.dev/note/projects/2026/07/18/proj-go-go-wm-scripting-a-window-manager-with-an-embedded-javascript-runtime)
- [projects/2026/05/23/article-goja-sandbox-architecture-lessons-from-go-go-goja-and-vm-system](http://parc.yolo.scapegoat.dev/note/projects/2026/05/23/article-goja-sandbox-architecture-lessons-from-go-go-goja-and-vm-system)
- [research/kb/projects/pi-extensions](http://parc.yolo.scapegoat.dev/note/research/kb/projects/pi-extensions)
- [projects/2026/04/26/article-report-go-go-goja-eventemitter-implementation](http://parc.yolo.scapegoat.dev/note/projects/2026/04/26/article-report-go-go-goja-eventemitter-implementation)
- [projects/2026/03/16/proj-go-go-goja-jsverbs-javascript-to-glazed-commands](http://parc.yolo.scapegoat.dev/note/projects/2026/03/16/proj-go-go-goja-jsverbs-javascript-to-glazed-commands)
- [research/software-architecture-garden/rag-evaluation-system/05-xgoja-provider-and-runtime-packaging](http://parc.yolo.scapegoat.dev/note/research/software-architecture-garden/rag-evaluation-system/05-xgoja-provider-and-runtime-packaging)
- [projects/2026/05/22/article-xgoja-compile-time-goja-module-composition-and-jsverbs-mounting](http://parc.yolo.scapegoat.dev/note/projects/2026/05/22/article-xgoja-compile-time-goja-module-composition-and-jsverbs-mounting)
- [projects/2026/04/27/proj-go-go-goja-yaml-and-run-support](http://parc.yolo.scapegoat.dev/note/projects/2026/04/27/proj-go-go-goja-yaml-and-run-support)
- [research/kb/projects/widget-dsl](http://parc.yolo.scapegoat.dev/note/research/kb/projects/widget-dsl)
- [projects/2026/06/14/article-go-go-goja-express-auth-from-planned-routes-to-generated-host-auth](http://parc.yolo.scapegoat.dev/note/projects/2026/06/14/article-go-go-goja-express-auth-from-planned-routes-to-generated-host-auth)
- [projects/2026/05/24/article-xgoja-generated-goja-applications-provider-architecture-and-runtime-profiles](http://parc.yolo.scapegoat.dev/note/projects/2026/05/24/article-xgoja-generated-goja-applications-provider-architecture-and-runtime-profiles)

## Sitemap

- [Home](http://parc.yolo.scapegoat.dev/)
- [Home markdown mirror](http://parc.yolo.scapegoat.dev/index.md)
- [Markdown sitemap](http://parc.yolo.scapegoat.dev/sitemap.md)
