Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6470737
GC
MelbourneDeveloper Jun 27, 2026
8087b23
chore: snapshot pre-existing GC backend WIP (docs/plans/0011)
MelbourneDeveloper Jun 27, 2026
06c2320
fix(codegen): width-stable string length + int formatting for 32-bit …
MelbourneDeveloper Jun 27, 2026
3809279
feat(cli,build): wasm32 target — compile Osprey to browser-ready WebA…
MelbourneDeveloper Jun 27, 2026
e5bfd3c
Stuff
MelbourneDeveloper Jun 27, 2026
d36bbdd
Stuff
MelbourneDeveloper Jun 27, 2026
0caf155
Auto stash before merge of "feature/wasm32-target" and "feature/wasm3…
MelbourneDeveloper Jun 27, 2026
8825ee4
Stuff
MelbourneDeveloper Jun 27, 2026
6354bc9
debugger etc
MelbourneDeveloper Jun 27, 2026
5326f64
fixes
MelbourneDeveloper Jun 27, 2026
bde68ec
fixes
MelbourneDeveloper Jun 27, 2026
c71a011
Stuff
MelbourneDeveloper Jun 27, 2026
8c5f92d
stuff
MelbourneDeveloper Jun 27, 2026
891663c
move all the things
MelbourneDeveloper Jun 27, 2026
b5f3c18
fixes
MelbourneDeveloper Jun 27, 2026
a194f55
Finalize debugger plan status
MelbourneDeveloper Jun 27, 2026
cbf6913
test(cli): cover wasm backend driver + debug/target dispatch [WASM-TA…
MelbourneDeveloper Jun 27, 2026
a3280db
docs(website): document random/randomBelow builtins [BUILTIN-RANDOM]
MelbourneDeveloper Jun 27, 2026
eb318eb
feat(debugger): VSIX debug panel + lldb-dap e2e suite; osprey-debug 1…
MelbourneDeveloper Jun 28, 2026
b78a66e
fix(ci): rustfmt test code, wasm sysroot extraction, lldb-dap in CI
MelbourneDeveloper Jun 28, 2026
7783d12
fixes
MelbourneDeveloper Jun 28, 2026
bcd9daa
fix(ci): modern lldb-dap for debugger E2E + assert F10 step-over [DEB…
MelbourneDeveloper Jun 28, 2026
fa0058c
fix(codegen): dbg.declare for locals to keep the debug line table cle…
MelbourneDeveloper Jun 28, 2026
1629a74
test(debugger): wait for a source-resolved frame in the DAP harness […
MelbourneDeveloper Jun 28, 2026
3ed6722
fix(ci): pin lldb-dap to 22 — the validated dev toolchain [DEBUGGER-L…
MelbourneDeveloper Jun 28, 2026
be42bc1
fix(make): scope VSIX targets to osprey only; add wasm-serve dev server
MelbourneDeveloper Jun 28, 2026
7ef767f
example(wasm): expand hello.osp into a full wasm-safe language tour
MelbourneDeveloper Jun 28, 2026
702edc2
Merge branch 'main' into feature/wasm32-browser-target
MelbourneDeveloper Jun 28, 2026
403de51
chore(benchmarks): restore full 22-case run (incl. GC backend)
MelbourneDeveloper Jun 28, 2026
ea2f9df
Stuff
MelbourneDeveloper Jun 29, 2026
1793448
fixes
MelbourneDeveloper Jun 29, 2026
4ab74e4
Stuff
MelbourneDeveloper Jun 29, 2026
679babe
First class handlers
MelbourneDeveloper Jun 29, 2026
35ea74e
Stuff
MelbourneDeveloper Jun 29, 2026
4504e93
Stuff
MelbourneDeveloper Jun 29, 2026
231222c
Language flavours
MelbourneDeveloper Jun 29, 2026
13dfe68
flavors
MelbourneDeveloper Jun 29, 2026
d4fb854
docs
MelbourneDeveloper Jun 29, 2026
c184469
Merge branch 'main' into prototyping
MelbourneDeveloper Jun 29, 2026
911aefb
MLflavor
MelbourneDeveloper Jun 29, 2026
0262b82
Stuff
MelbourneDeveloper Jun 29, 2026
2f64ca3
Language flavors
MelbourneDeveloper Jun 30, 2026
c598e5d
Flavor flav
MelbourneDeveloper Jun 30, 2026
99304d8
Stuff
MelbourneDeveloper Jun 30, 2026
ce0f4b5
Flava flav
MelbourneDeveloper Jun 30, 2026
1b69920
Specs
MelbourneDeveloper Jun 30, 2026
0c80eb4
stuff
MelbourneDeveloper Jun 30, 2026
92800d3
Models and namespaces
MelbourneDeveloper Jun 30, 2026
b96c04e
Fixes
MelbourneDeveloper Jul 1, 2026
7da9b69
Merge branch 'main' into prototyping
MelbourneDeveloper Jul 1, 2026
9d0cefb
Docs update etc.
MelbourneDeveloper Jul 1, 2026
a52da6b
fixes
MelbourneDeveloper Jul 1, 2026
e73ef79
fixes
MelbourneDeveloper Jul 1, 2026
1324194
fixes
MelbourneDeveloper Jul 1, 2026
d1035d4
fixes
MelbourneDeveloper Jul 1, 2026
e70971b
fixes
MelbourneDeveloper Jul 1, 2026
d7e1def
fixes
MelbourneDeveloper Jul 1, 2026
dacd5ed
fixes
MelbourneDeveloper Jul 1, 2026
888d7cf
fixes
MelbourneDeveloper Jul 1, 2026
894f2a4
fixes
MelbourneDeveloper Jul 1, 2026
a81f836
fixes
MelbourneDeveloper Jul 1, 2026
5fa329f
test
MelbourneDeveloper Jul 1, 2026
fd42e78
test(vsix): cover osprey-test-env PATH resolvers
MelbourneDeveloper Jul 1, 2026
307009a
test(vsix): drop cross-platform-broken lldb PATH unit test; add host …
MelbourneDeveloper Jul 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"permissions": {
"allow": [
"Bash(make test:*)",
"Bash(go test:*)",
"Bash(go run:*)",
"Bash(find:*)",
"Bash(make build:*)",
"Bash(bin/osprey:*)",
"Bash(/dev/null)",
"Read(//tmp/**)",
"Bash(git log:*)",
"Bash(./bin/osprey compile:*)",
"Bash(./bin/osprey:*)"
],
"deny": [],
"ask": []
},
"autoMemoryEnabled": false
}
16 changes: 11 additions & 5 deletions .deslop.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@
# of scope here).
# Docs: https://deslop.live/docs/for-ai/
[threshold]
# Measured 9.20% (2026-06-22; 18.03% when the gate was introduced). Ceiling sits
# just above measured to absorb cross-runner float jitter. Ratchet DOWN as
# duplication is removed — worst offenders today are osprey-types/builtins.rs and
# codegen's expr.rs (see `deslop top-offenders`).
max_duplication_percent = 9.5
# Ratcheted DOWN to 6.5% (2026-06-30) per project directive. Was 9.5%; measured
# duplication is driven below this ceiling by deduping real code clones and
# scoping the gate to hand-written product code (see `exclude` below). Ratchet
# DOWN only as duplication is removed — worst real-code offenders are codegen's
# pattern.rs/effects.rs and the per-file type-checker test harnesses.
max_duplication_percent = 6.5

[defaults]
exclude = [
"**/tests/**",
# Vendored, generated tree-sitter grammar bindings — not hand-written.
"tree-sitter-osprey/**",
# Cross-language benchmark baselines: each case is a standalone single-file
# program compiled in isolation by benchmarks/run.sh (no shared crate exists
# to factor into), so the identical scaffolding across cases is intrinsic to
# the benchmark design, not a refactorable product-code clone.
"benchmarks/**",
]
30 changes: 29 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ jobs:
website:
name: Website E2E (Playwright)
runs-on: ubuntu-latest
timeout-minutes: 15
timeout-minutes: 30
defaults:
run:
working-directory: ./website
Expand All @@ -303,6 +303,34 @@ jobs:
cache: 'npm'
cache-dependency-path: website/package-lock.json

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-website-wasm-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-website-wasm-

- name: Install wasm toolchain
run: |
sudo apt-get update
sudo apt-get install -y clang llvm lld wabt zsh
WASI_VERSION=24
curl -fsSL -o /tmp/wasi-sysroot.tar.gz \
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sysroot-${WASI_VERSION}.0.tar.gz"
sudo mkdir -p /opt/wasi-sdk/share/wasi-sysroot
sudo tar -xzf /tmp/wasi-sysroot.tar.gz -C /opt/wasi-sdk/share/wasi-sysroot --strip-components=1
test -d /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasip1
echo "OSPREY_WASI_SYSROOT=/opt/wasi-sdk/share/wasi-sysroot" >> "$GITHUB_ENV"
wasm-ld --version
working-directory: .

- name: Install dependencies
run: npm ci

Expand Down
42 changes: 32 additions & 10 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build-and-deploy:
name: Build Documentation and Deploy to GitHub Pages
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 30
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -34,23 +34,45 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# NOTE: the Osprey compiler is intentionally NOT built here. The website
# ships committed reference docs as the source of truth; generate-docs.sh
# only regenerates them when an osprey binary that supports `--docs` is
# present (it isn't yet), and otherwise exits cleanly. Building the Rust
# compiler + LLVM here took 10+ min and blew the job timeout, which is why
# the live site stopped updating. Re-add a compiler-setup step only once
# `osprey --docs` lands and docs need regenerating at deploy time.

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-pages-wasm-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-pages-wasm-

- name: Install wasm toolchain
run: |
sudo apt-get update
sudo apt-get install -y clang llvm lld wabt zsh
WASI_VERSION=24
curl -fsSL -o /tmp/wasi-sysroot.tar.gz \
"https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sysroot-${WASI_VERSION}.0.tar.gz"
sudo mkdir -p /opt/wasi-sdk/share/wasi-sysroot
sudo tar -xzf /tmp/wasi-sysroot.tar.gz -C /opt/wasi-sdk/share/wasi-sysroot --strip-components=1
test -d /opt/wasi-sdk/share/wasi-sysroot/lib/wasm32-wasip1
echo "OSPREY_WASI_SYSROOT=/opt/wasi-sdk/share/wasi-sysroot" >> "$GITHUB_ENV"
wasm-ld --version

- name: Install website dependencies
working-directory: ./website
run: npm ci

- name: Build website WebAssembly demo
run: make wasm-site

- name: Build website (uses committed reference docs)
working-directory: ./website
run: npm run build
Expand All @@ -63,7 +85,7 @@ jobs:

- name: End-to-end tests
working-directory: ./website
run: npm test
run: npx playwright test

- name: Setup Pages
uses: actions/configure-pages@v4
Expand Down
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ compiler/bin/
compiler/lib/
compiler/outputs/
compiler/internal/codegen/bin/
examples/wasm/build/
*.wasm
*.exe
*.exe~
*.dll
Expand Down Expand Up @@ -121,4 +123,10 @@ benchmarks/cases/**/*.cmi
benchmarks/cases/**/*.cmx
benchmarks/cases/**/*.o

.osprey-debug
.osprey-debug


scratchpad/


__pycache__/
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@
"esbenp.prettier-vscode",
"GitHub.copilot",
"GitHub.vscode-pull-request-github"
],
"unwantedRecommendations": [
"hbenl.vscode-test-explorer",
"ms-vscode.test-adapter-converter",
"kondratiev.vscode-rust-test-adapter"
]
}
17 changes: 15 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,18 @@
"//6": "The server execs this path verbatim (no variable substitution), so it",
"//7": "is absolute. Run `make build` to refresh it; see `make vsix` for packaging.",
"//8": "NOTE: compiler/bin is the C-runtime archive dir, NOT the compiler binary.",
"osprey.server.compilerPath": "/Users/christianfindlay/Documents/Code/osprey/target/release/osprey"
}
"osprey.server.compilerPath": "/Users/christianfindlay/Documents/Code/osprey/target/release/osprey",
"//9": "Force rust-analyzer to own native VS Code test discovery for the root Cargo workspace.",
"rust-analyzer.testExplorer": true,
"rust-analyzer.linkedProjects": [
"/Users/christianfindlay/Documents/Code/osprey/Cargo.toml"
],
"rust-analyzer.cargo.allTargets": true,
"rust-analyzer.cargo.autoreload": true,
"rust-analyzer.cargo.buildScripts.enable": true,
"rust-analyzer.cfg.setTest": true,
"rust-analyzer.check.command": "clippy",
"rust-analyzer.check.allTargets": true,
"basilisk.enabled": true,
"basilisk.uv.enabled": true
}
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"crates/osprey-debug",
"crates/osprey-codegen",
"crates/osprey-runtime-sys",
"crates/osprey-fmt",
"crates/osprey-lsp",
"crates/osprey-cli",
]
Expand All @@ -29,6 +30,7 @@ osprey-syntax = { path = "crates/osprey-syntax" }
osprey-types = { path = "crates/osprey-types" }
osprey-debug = { path = "crates/osprey-debug" }
osprey-codegen = { path = "crates/osprey-codegen" }
osprey-fmt = { path = "crates/osprey-fmt" }
osprey-lsp = { path = "crates/osprey-lsp" }
tree-sitter-osprey = { path = "tree-sitter-osprey" }

Expand Down
47 changes: 40 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# --run`) and TypeScript sub-projects (vscode-extension, webcompiler, website).
# =============================================================================

.PHONY: build test lint fmt clean ci setup run install bench wasm wasm-serve vsix-rebuild-reinstall
.PHONY: build test lint fmt clean ci setup run install bench wasm wasm-site wasm-serve vsix-rebuild-reinstall

# ---------------------------------------------------------------------------
# OS Detection
Expand Down Expand Up @@ -74,8 +74,11 @@ HTTP_OBJ_GC ?= bin/http_shared.o bin/http_client_runtime.o bin/http_server_runti
# WebAssembly (wasm32-wasip1) cross-build toolchain — opt-in via `make wasm`.
# Compiles the portable C-runtime subset (no pthreads/sockets/OpenSSL/syscalls)
# to a wasm archive osprey links with `--target=wasm32`. See docs/specs/0022.
WASM_CC ?= clang
WASM_AR ?= llvm-ar
WASM_LLVM_BIN ?= $(shell for d in /opt/homebrew/opt/llvm/bin /usr/local/opt/llvm/bin; do [ -x "$$d/clang" ] && { echo "$$d"; break; }; done)
WASM_LLD_BIN ?= $(shell for d in /opt/homebrew/opt/lld/bin /usr/local/opt/lld/bin "$(WASM_LLVM_BIN)"; do [ -n "$$d" ] && [ -x "$$d/wasm-ld" ] && { echo "$$d"; break; }; done)
WASM_PATH_PREFIX ?= $(shell for d in "$(WASM_LLVM_BIN)" "$(WASM_LLD_BIN)"; do [ -n "$$d" ] && printf "%s:" "$$d"; done)
WASM_CC ?= $(if $(WASM_LLVM_BIN),$(WASM_LLVM_BIN)/clang,clang)
WASM_AR ?= $(if $(WASM_LLVM_BIN),$(WASM_LLVM_BIN)/llvm-ar,llvm-ar)
WASM_TARGET ?= wasm32-wasip1
# WASI sysroot (libc + crt1). Override with WASI_SYSROOT=/path; else probe the
# Homebrew (macOS), wasi-sdk and common Linux locations in turn.
Expand Down Expand Up @@ -138,10 +141,12 @@ clean:
ci: lint test build

## wasm: Build everything for the WebAssembly target, ready to go — the wasm
## runtime archive (compiler/bin/libosprey_runtime_wasm.a) and the compiled
## browser example (examples/wasm/build/hello.wasm) — then validate it and
## smoke-run it under Node's WASI, the browser WASI shim, and the full golden
## suite. Requires clang (wasm32 backend), wasm-ld and a WASI sysroot —
## runtime archive (compiler/bin/libosprey_runtime_wasm.a), the hello example,
## and Osprey Data Studio in BOTH flavors (studio.{osp,ospml} -> one byte-
## identical manifest that drives the SQLite dashboard in examples/wasm/
## index.html) — then validate them and smoke-run under Node's WASI, the browser
## WASI shim, and the full golden suite. Requires clang (wasm32 backend),
## wasm-ld and a WASI sysroot —
## `brew install lld wasi-libc` (macOS) or the wasi-sdk. See
## docs/specs/0022-WebAssemblyTarget.md.
wasm: build _runtime_wasm
Expand All @@ -152,12 +157,40 @@ wasm: build _runtime_wasm
@command -v wasm-validate >/dev/null 2>&1 && wasm-validate examples/wasm/build/hello.wasm || echo "(wasm-validate not found — skipping structural check)"
node scripts/wasm-smoke.mjs examples/wasm/build/hello.wasm examples/wasm/hello.expectedoutput
node scripts/wasm-browser-smoke.mjs examples/wasm/build/hello.wasm examples/wasm/hello.expectedoutput
@echo "==> compiling Osprey Data Studio (BOTH flavors) -> examples/wasm/build/"
$(BIN) examples/wasm/studio.osp --target=wasm32 --compile -o examples/wasm/build/studio.osp.wasm
$(BIN) examples/wasm/studio.ospml --target=wasm32 --compile -o examples/wasm/build/studio.ospml.wasm
@command -v wasm-validate >/dev/null 2>&1 && wasm-validate examples/wasm/build/studio.osp.wasm && wasm-validate examples/wasm/build/studio.ospml.wasm || echo "(wasm-validate not found — skipping structural check)"
@echo "==> both Studio flavors must emit the SAME manifest (byte-identical golden)"
node scripts/wasm-smoke.mjs examples/wasm/build/studio.osp.wasm examples/wasm/studio.expectedoutput
node scripts/wasm-browser-smoke.mjs examples/wasm/build/studio.osp.wasm examples/wasm/studio.expectedoutput
node scripts/wasm-smoke.mjs examples/wasm/build/studio.ospml.wasm examples/wasm/studio.expectedoutput
node scripts/wasm-browser-smoke.mjs examples/wasm/build/studio.ospml.wasm examples/wasm/studio.expectedoutput
@echo "==> [wasm differential] osprey --target=wasm32 vs examples/tested..."
@out=$$(zsh crates/diff_wasm_examples.sh); echo "$$out"; \
echo "$$out" | grep -Eq '(^| )FAIL=0 ' || { echo 'FAIL: wasm differential mismatch'; exit 1; }; \
echo "$$out" | grep -Eq '(^| )NOEXP=0 ' || { echo 'FAIL: example missing .expectedoutput'; exit 1; }
@echo "==> wasm ready: built + validated + WASI/browser smoke + golden suite green"

wasm wasm-site _runtime_wasm: export PATH := $(WASM_PATH_PREFIX)$(PATH)

## wasm-site: Build only the WebAssembly artifacts published by the website.
## Used by GitHub Pages before `npm run build`; does not rely on checked-in
## wasm binaries. Requires clang, wasm-ld, a WASI sysroot, and node.
wasm-site: _runtime_wasm
@echo "==> building osprey compiler for the website wasm demo"
cargo build --release -p osprey-cli
@echo "==> compiling Osprey Data Studio website assets -> examples/wasm/build/"
@$(MKDIR) examples/wasm/build
$(BIN) examples/wasm/studio.osp --target=wasm32 --compile -o examples/wasm/build/studio.osp.wasm
$(BIN) examples/wasm/studio.ospml --target=wasm32 --compile -o examples/wasm/build/studio.ospml.wasm
@command -v wasm-validate >/dev/null 2>&1 && wasm-validate examples/wasm/build/studio.osp.wasm && wasm-validate examples/wasm/build/studio.ospml.wasm || echo "(wasm-validate not found — skipping structural check)"
node scripts/wasm-smoke.mjs examples/wasm/build/studio.osp.wasm examples/wasm/studio.expectedoutput
node scripts/wasm-browser-smoke.mjs examples/wasm/build/studio.osp.wasm examples/wasm/studio.expectedoutput
node scripts/wasm-smoke.mjs examples/wasm/build/studio.ospml.wasm examples/wasm/studio.expectedoutput
node scripts/wasm-browser-smoke.mjs examples/wasm/build/studio.ospml.wasm examples/wasm/studio.expectedoutput
@echo "==> website wasm demo ready"

## wasm-serve: Build the wasm target (full `make wasm`), then static-host
## $(WASM_SERVE_DIR) at http://localhost:$(WASM_SERVE_PORT)/ and open it in
## your browser. Long-running dev server — Ctrl-C to stop. Override the port
Expand Down
Loading
Loading