apollovm_wasm
Native (Dart VM) WebAssembly execution for ApolloVM: the wasm_run-backed WasmRuntime, kept out of the core package so apollovm stays FFI-free.
1.2.0
228 downloads/mo
#1214 most downloaded on pub.dev
ApolloVM/apollovm_dart
What this package is like to depend on
Last release 22 days ago
02 Aug 2026
Too new to tell
only 2 release windows
Nearly every release is documented
notes for 3 of 3 stable releases
Nothing withdrawn
no release was ever pulled
1 months old
3 releases · first in 2026
3 releases in the last 12 months
see the full history below
Release timeline
3 releases · Jul 2026 to Aug 2026Releases
latest 3-
1.2.002 Aug 2026Release notes
Open source →Language Server Protocol (LSP 3.17) server
- A Dart-first language server is now part of the
apollovmpackage, exposed as a separate librarypackage:apollovm/apollovm_lsp.dart(the existingpackage:apollovm/apollovm.dartexports are unchanged). Source lives inlib/src/lsp/. - Runnable two ways. Locally over stdio via a new CLI subcommand
apollovm lsp; and embedded / web — the library imports nodart:io, so a browser IDE or an AI agent can drive it with decoded JSON-RPC messages viaMessageLspEndpoint(no byte framing).StreamLspEndpointprovidesContent-Lengthframing for stdio/sockets. Both share a transport-agnosticLspEndpoint. - The server keeps the ApolloVM core read-only: because the AST carries no source positions and the parser discards comments, a small self-contained scanner re-scans raw text for identifier/declaration positions and correlates them back to the AST (the source of truth for semantics). Four strictly separated layers keep LSP logic out of the parser — transport, protocol (LSP 3.17 types), analysis (parse/index/resolve), and server (handlers).
- Implemented:
initialize/shutdown, incremental diagnostics (parse + unresolvable core imports),documentSymbol,hover(kind/signature/type/ documentation),definition; plus single-filereferences/renameand a basic rankedcompletion. - Parse-error diagnostics are located precisely: since the core parser reports a
generic "end of input expected" at offset 0 for most structural mistakes, the
server runs a bracket-balance analysis to underline the real culprit (e.g. an
unclosed
(/{) with a hint, instead of pointing at the top of the file. - Companion assets live under
lsp/(excluded from the published package via.pubignore): a VS Code client (lsp/vscode), an example workspace (lsp/example_workspace), and a latency benchmark (lsp/benchmark). - Verified with
dart analyze(clean), 17 passing tests intest/lsp/(including full stdio and message-level protocol sessions), and a benchmark comfortably under its latency targets (open, hover, completion).
Optional Dart package importer (pub.dev / pubspec-compatible)
package:imports can now be resolved against real pub packages, via an optional importer exposed atpackage:apollovm/apollovm_pub.dart(kept out of the web-safeapollovm.dart).- Pluggable
PackageProvider:PackageConfigProvider(default, VM-only, zero extra deps — resolves through.dart_tool/package_config.json, exact pub semantics) andPubDevProvider(web-compatible) — downloads archives from pub.dev or a configurable/private/mirror host, extracts them in memory, caches them (MemoryPackageCacheby default,FilePackageCacheon the VM), and honors pubspec version constraints. Built on web-safe libraries only (http,archive,pub_semver,yaml— nodart:io), so it runs on the VM and in the browser. - Web/CORS:
PubDevProvideraccepts an injectablehttp.Client, a custom host, and arewriteUrlhook to route requests through a CORS proxy — a ready-made proxy ships intool/pub_cors_proxy.dart. DartPackageLoader+DartPackageImporter.provision()fetch each reachablepackage:import transitively and load its source into the VM; injected via the new settableApolloVM.moduleLoader. A genericCompositeModuleLoaderchains loaders.- CLI:
apollovm run/translate --pub(with--pub-host/--pub-cache) resolvespackage:imports before executing. - Promotes
http,archive,pub_semver,yamlto direct dependencies (all web-safe); only the filesystem members (PackageConfigProvider,FilePackageCache) are behind conditional imports with web stubs. - See
doc/module_resolution.mdandexample/apollovm_example_pub_importer.dart.
- Pluggable
Language-agnostic package/module import system
- Cross-module imports now resolve and execute. A source file can import
symbols (classes, functions, enums, type aliases) from other loaded modules,
normalized into a single canonical AST regardless of language.
- Enriched
ASTStatementImport(named/show/hide, wildcard, whole-module prefix alias, per-symbol alias) plus newASTStatementExportandASTTypeAliasnodes. - New web-safe resolution layer (
lib/src/resolution/): pluggableModuleLoader(in-memoryVMModuleLoader), four-levelSymbolTables +ImportScope,ModuleResolver, aDependencyGraph(Tarjan cycle detection, Kahn topological order, incrementalaffectedByinvalidation), structuredImportDiagnostics (missing module/symbol, duplicate symbol, circular import, invalid export), aResolutionCache, and theModuleResolutionEnginefacade. ApolloVM.resolve()returns aggregated diagnostics; resolution is triggered lazily by the runner and invalidated incrementally onloadCodeUnit.- Parse + generate wired for Dart, TypeScript, and Python (named/
show/hide/wildcard/alias/re-export/typedef); other languages keep basic imports and compile unchanged against the additive AST. - Golden-test harness extended for multi-
<source>(cross-module) tests. - See
doc/module_resolution.mdandexample/apollovm_example_imports.dart.
- Enriched
New language:
Go- Added first-class Go support — ApolloVM can now parse, execute, and
translate Go source (
.go/go, aliasgolang) through the shared AST, bidirectionally with every other supported language (and on-the-fly Wasm). - Implemented under
lib/src/languages/go/(go_grammar_lexer.dart,go_grammar.dart,go_generator.dart,go_parser.dart,go_runner.dart) and wired intoApolloVM(getParser/createRunner/createCodeGeneratorand the.gofile-extension mapping). - Supported: top-level and struct receiver methods (
func (o *Name) m(...)),structtypes with fields and factory constructors (func NewName(...) *Name),var/:=type inference,if/else if/else, the fourforforms (C-style, condition-only aswhile,rangeas for-each, infinite /do-while), Goswitch(no fall-through), slices/maps ([]T{…},map[K]V{…}), closures, all arithmetic/comparison/logical/bitwise operators, string+concatenation, andfmt.Println(normalized to the VM'sprint). - Go has no classes: a class is modeled as a
struct+ receiver methods (the same idiom Lua uses for tables), so OOP code round-trips across all languages. See the README feature tables for the full per-feature matrix;try/catch/throw, inheritance/interfaces, rich enums and generics are not yet implemented for Go.
MCP-native runtime: expose ApolloVM to AI agents over the Model Context Protocol
- New
apollovm mcpcommand group exposes ApolloVM as an MCP (Model Context Protocol) server and tools, turning it into a programmable, sandboxed execution engine for AI agents. Built on the officialdart_mcpSDK. Subcommands:mcp serve(run the server over stdio or HTTP/SSE via--http <port>),mcp list(tool definitions),mcp call <tool>(one-shot tool invocation for scripting/CI),mcp info,mcp schema, andmcp doctor. - Seven tools:
apollovm.parse,apollovm.execute,apollovm.translate,apollovm.ast,apollovm.symbols,apollovm.types,apollovm.wasm— parse, run, translate, compile to Wasm, and inspect AST / symbol graph / type table across all supported languages. - Security model: file/network access denied by construction (only
printis exposed; inputs are inline source only);apollovm.executeruns in a killable isolate so a hard timeout is enforced even against runaway synchronous loops (per-tool configurable via--isolate-tools); input/output size caps (--max-source-chars,--max-output-chars); best-effort process-level memory. - New public library
package:apollovm/apollovm_mcp.dart(ApolloMcpServer,serveStdio,HttpSseTransport,McpLimits,computeTool). - Added dependency
dart_mcp: ^0.5.2(andstream_channel). Newmcp-tagged integration tests undertest/mcp/. Seedoc/MCP.md.
Release notes
Open source →-
apollovm: ^2.25.0(was^2.0.0) — this runtime decodes what theapollovmWasm generator encodes, and the boxed-Objectcell layout ([tag@0][typeId@4][payload@8]) with its_boxTag*values is a contract between the two:wasm_runner.dartandwasm_generator.darteach carry a comment saying the constants must match.^2.0.0let pub pair this runtime with anyapollovm2.x, including releases whose box encoding it was never built or tested against — a mismatch that surfaces as a wrong value or a trap at run time, not as a resolution error. The constraint now tracks the release the runtime is cut against; it is widened deliberately, not by default.apollovm 2.25.0 is a case in point: it added
?.on a boxed slot, which emits box reads this runtime has to agree with. -
wasm_run: ^0.2.0+2(was^0.2.0+1) — patch upgrade, no API change.
- A Dart-first language server is now part of the
-
1.1.026 Jul 2026Release notes
Open source →-
wasm_run: ^0.2.0+1(was^0.1.0+2) — a breaking upgrade, absorbed here so that consumers keep the sameWasmRuntimeIOAPI:- No install step.
dart run wasm_run:setupis gone; the SDK's build hooks download the native library into.dart_tool/lib/duringdart run/dart test/dart compile. That directory is now searched first, along with.dart_tool/wasm_run/(thewasm_run:build_binariesoutput) — walking up to every enclosing package root, so a nested package finds a library fetched by its workspace. - The bindings moved to
flutter_rust_bridge2.x, so the symbol that identifies a genuinewasm_runlibrary changed (wire_compile_wasm→frb_get_rust_content_hash); validating the old one rejected every 0.2 library. wasm_run0.2 initializes its Rust bindings asynchronously and no longer finds its own library in a pure-Dart app.WasmRunLibrary.setUp()is now awaited once, lazily, on the first module compile —ensureBooted()/isSupportedstay synchronous, asWasmRuntimerequires, and only probe for the library.WASM_RUN_DART_DYNAMIC_LIBRARY(the variablewasm_runitself reads) now overrides the library path. The olderWASM_RUN_LIB_PATHis still honored, and is finally read as a path: it used to be consulted only on platforms with no known library name, and then joined with candidate directories as if it were a file name.
- No install step.
-
Requires Dart >= 3.10 (build hooks), matching
wasm_run0.2. -
Known issue (macOS on Apple Silicon). The upstream
aarch64-apple-darwin0.2.0 library is killed by macOS (SIGKILL, Code Signature Invalid) when wasmtime executes JIT-compiled Wasm inside the JIT Dart VM, i.e. underdart run/dart test. Compiling and instantiating modules is fine. Usedart test --compiler exe/dart compile exethere; other platforms are unaffected. See the README.
-
-
1.0.013 Jul 2026Release notes
Open source →-
Initial release: the native (Dart VM)
WasmRuntime, extracted frompackage:apollovm2.0.0.ApolloVM compiles to Wasm everywhere, but executing a module on the Dart VM needs a native engine (
wasm_run), which drags an FFI/Rust toolchain — and an oldflutter_rust_bridge— into every consumer ofapollovm, even the ones that only parse or translate code. That cost now lives here.Call
registerApolloVMWasmRuntime()to install it;WasmRuntime()then executes on the VM as before.
-