Reach Phase 0: serverless on-ramps — Lambda adapter, deploy examples, cold-start benchmarks#75
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…LYGLOT Sequenced plan for serverless on-ramps, HTTP/1.1 completeness, C FFI + bindgen, libturbo embedding wrappers, WASM/WASI completion, async I/O, and post-1.0 TLS/HTTP2. Records the npm/PyPI package-compat refusal as a durable decision. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ld-start benchmarks Serverless on-ramps per design/REACH-ROADMAP.md Phase 0: - packages/turbo-lambda: pure-Turbo AWS Lambda custom-runtime adapter. Handler is one safe fn(str) -> str; lambda_run(handler) is the loop. /invocation/next via exec'd curl -si (request id arrives in a response header the built-in http_get can't read); responses via http_post with TURBO_ALLOW_PRIVATE_HOSTS=1 exported by the bootstrap. 17 unit tests on the pure parsing core; registered in the package index (7 first-party packages now). - examples/deploy/lambda: function + 2-line bootstrap + cross-compile/zip/ create-function walkthrough + test_local.sh, a full end-to-end run against a faithful mock runtime API (passes, no AWS account needed). - examples/deploy/cloud-run + examples/deploy/fly: self-contained multi-stage Dockerfiles (install released toolchain -> AOT compile -> slim runtime image), PORT env + 0.0.0.0 bind, health checks; fly.toml with scale-to-zero. Image built and container verified serving locally. Note: released turbolang binaries need glibc >= 2.39, hence trixie-slim. - benchmarks/serverless: reproducible cold-start scripts (Lambda Init Duration over N forced cold starts for identical Turbo/Node/Python functions, plus a local process-start proxy). No numbers published that the scripts didn't generate. - docs/serverless.md ties it together; linked from README and examples index. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rketing sweep - http_get_raw(url) -> str: raw response (status line + headers + body) in both runtimes (Rust JIT + turbo_rt.c, Windows AOT stub), with the same SSRF guard and 30s bound as http_get; no redirect following (each hop would prepend its own header block). Unit-tested against a local one-shot server, with an env-lock so the SSRF opt-out tests can't race. - turbo-lambda: /invocation/next now reads the request-id header via http_get_raw instead of exec'd curl — the package and user main() are fully safe (no @unsafe anywhere). e2e mock-API test still passes. - Docs/marketing sweep: stdlib.md entry, CHANGELOG Unreleased section, COMPATIBILITY matrix row, serverless.md + package/example READMEs updated for the native transport, REACH-ROADMAP marks the client-header item as pulled forward from Phase 1; website homepage Zero-GC card now carries the serverless story and docs/examples page lists the three deploy examples (build verified). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5798d03 to
ade3d1b
Compare
…rbo_version - rustfmt: two files from the http_get_raw change - clippy (newer stable toolchain in CI): match-to-? in resolve_type_expr FnType param resolution (pre-existing code, surfaced by toolchain drift) - turbo-lambda min_turbo_version 0.14.0 -> 0.15.0: the package requires the http_get_raw builtin, which first ships in the next release Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
….97 lint) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase 0 of the new Reach roadmap (
design/REACH-ROADMAP.md, included here): make Turbo deployable to serverless platforms today — plus the one compiler addition the adapter needed, pulled forward from Phase 1.design/REACH-ROADMAP.md— the sequenced plan (serverless → HTTP/1.1 completeness → C FFI/bindgen → libturbo embedding → WASM/WASI → async I/O → post-1.0 TLS), plus a durable npm/PyPI compat refusal recorded indesign/POLYGLOT.md.http_get_raw(url)builtin — HTTP GET returning the raw response (status line + headers + body) so protocol clients can read response headers. Both runtimes (Rust JIT +turbo_rt.c), Windows AOT stub, same SSRF guard + 30s bound ashttp_get, no redirect following. Unit-tested against a local one-shot server with an env-lock so the SSRF opt-out tests can't race.packages/turbo-lambda— pure-Turbo AWS Lambda custom-runtime adapter. One safefn(str) -> strhandler;lambda_run(handler)is the whole loop; no@unsafeanywhere (/invocation/nextreads the request-id response header viahttp_get_raw). 17 unit tests. Registered in the package index (7 first-party packages).examples/deploy/lambda— bootstrap + cross-compile/zip/create-function walkthrough +test_local.shend-to-end test against a faithful mock runtime API (no AWS account needed).examples/deploy/cloud-run/examples/deploy/fly— self-contained multi-stage Dockerfiles (released toolchain → AOT compile → slim runtime image),PORT+0.0.0.0, health checks, scale-to-zero fly.toml.benchmarks/serverless— reproducible cold-start scripts (Lambda Init Duration over N forced cold starts, Turbo vs Node vs Python, plus a local proxy). No published numbers — run-it-yourself by policy.docs/serverless.md(README-linked), stdlib entry forhttp_get_raw, CHANGELOG Unreleased section, COMPATIBILITY matrix, website homepage card + docs/examples page (site build verified).Verification
cargo test --workspace— all green (incl. newhttp_get_rawunit tests + SSRF-guard negative test)turbo/tests/run_tests.sh— 349 passed, 0 failedtests.sh(ASan) — all pass (turbo_rt.cchanged)turbolang test packages/turbo-lambda/tests— 17/17examples/deploy/lambda/test_local.sh— end-to-end vs mock runtime API, on the new native transport--target linux-x86cross-compile verifiednpm run build— greenNotes
🤖 Generated with Claude Code