---
title: "AssemblyScript: the TypeScript-shaped path into WebAssembly"
description: "AssemblyScript is a TypeScript-like way to target WebAssembly. This explainer shows how source becomes a sandboxed module, crosses explicit host boundaries, and fits performance-sensitive services."
---

# AssemblyScript: the TypeScript-shaped path into WebAssembly

**Type:** [What is it?](https://yomu.fyi/visual-explainers/category/what-is-it.md)

![Diagram showing AssemblyScript as TypeScript-like source feeding a WebAssembly module, with sandboxing and explicit host imports connecting it to a runtime, plus performance and integration notes.](https://yomufyi.s3.us-east-1.amazonaws.com/visual-explainers/3cf19eb6-8975-4368-9748-b68ee9b6d727/image-93361603-b39f-46f0-acd9-6d47abf02ba3.webp)

> AssemblyScript is a TypeScript-like way to target WebAssembly. This explainer shows how source becomes a sandboxed module, crosses explicit host boundaries, and fits performance-sensitive services.

## Explanation

AssemblyScript gives teams a TypeScript-like language option for building WebAssembly modules. The diagram follows one path from typed source to a sandboxed, stack-based module, then to a host runtime through explicit imports for input, output, and storage. It also highlights the engineering trade-off: near-native execution and reduced network work can come with new runtime, SDK, monitoring, and host-integration responsibilities.

## FAQ

### Why use AssemblyScript instead of another WebAssembly source language?

The supplied Shopify case describes choosing AssemblyScript for its TypeScript-like syntax and first-class developer support. The broader WebAssembly benefit is the ability to target a sandboxed execution environment from multiple source languages, so language familiarity and tooling can be practical selection factors.

### What crosses the boundary between a WebAssembly module and its host?

The host explicitly imports the capabilities the module can use rather than exposing an unrestricted environment. Shopify’s description calls out module I/O and storage management in the surrounding Wasm Engine, making those host integrations important design and operational surfaces.

### What is the performance trade-off?

Shopify reports Lucet execution around 100 microseconds in a test and total p99 execution time around 4 milliseconds, while also emphasizing sandboxing and reduced network latency for time-sensitive customizations. Actual results depend on the module and surrounding host service, so execution speed should be evaluated with end-to-end measurements.

**Tags:** [AssemblyScript](https://yomu.fyi/topic/assemblyscript.md), [Performance](https://yomu.fyi/topic/performance.md), [Sandboxing](https://yomu.fyi/topic/sandboxing.md), [TypeScript](https://yomu.fyi/topic/typescript.md), [WebAssembly](https://yomu.fyi/topic/webassembly.md)

## Related reading

### [Introducing automatic remediation policies with Cloudflare CASB](https://yomu.fyi/post/introducing-automatic-remediation-policies-with-cloudflare-casb.md)
- Company: [Cloudflare](https://yomu.fyi/company/cloudflare.md)
- Author: Michael Leslie
- Published: Sep 11, 2026
- Type: Announcement

Cloudflare CASB now supports automatic remediation policies that respond to newly detected SaaS security findings without requiring an administrator to act on each instance. Teams can match policies by vendor, integration or tenant, and finding type, then revoke file-sharing access, send finding details to webhooks, or do both; first-party remediation currently covers Microsoft and Google Workspace file and folder findings. The backend enqueues findings to Cloudflare Queues, uses a Worker to match policy configurations, and runs matched jobs through Cloudflare Workflows, which provides durable execution, retries, and rate-limit backoff. Policies generate administrator-activity and runtime execution logs, while the stated target from detection to completed remediation is five minutes or less; support for Custom Findings is planned for the coming weeks.


### [AI Functions in ClickHouse: Upgrade your SQL to the AI age](https://yomu.fyi/post/ai-functions-in-clickhouse-upgrade-your-sql-to-the-ai-age.md)
- Company: [Clickhouse](https://yomu.fyi/company/clickhouse.md)
- Published: Sep 11, 2026
- Type: Explainer

ClickHouse’s beta AI Functions let SQL queries call an LLM or embedding provider directly, keeping classification, extraction, generation, translation, redaction, filtering, embedding, and similarity work alongside stored data. The feature addresses workflows that export rows to separate LLM, orchestration, or vector-database systems and then reload results, with the stated goal of running the full RAG cycle in ClickHouse. Functions make remote HTTP calls per input, or batch embedding inputs, and return native ClickHouse values; in open-source deployments, named collections store provider credentials and endpoint settings. Examples use Hacker News data for topic classification and natural-language filtering, while the guidance emphasizes cheap predicates, quotas, LIMIT tests, prompt-injection defenses, non-determinism, cost, latency, and provider access to data in cleartext after TLS termination.


### [Halving the Time: How Uber Eats Rebuilt Its Search Pipeline](https://yomu.fyi/post/halving-the-time-how-uber-eats-rebuilt-its-search-pipeline.md)
- Company: [Uber](https://yomu.fyi/company/uber.md)
- Published: Sep 10, 2026
- Type: Problem & solution

Uber Eats rebuilt its search pipeline after accumulated architectural decisions made latency increasingly costly across retrieval, hydration, ranking, ads, and presentation. The team changed its primary metric from backend API response time to Above-the-Fold completion, then introduced paginated responses with server-side caching and concurrent template rendering; these changes improved ATF by over 200 milliseconds. Other work removed low-yield retrieval strategies, grouped items by product identity to reduce lookups by over 100 times, split ranking and presentation hydration, eliminated false DAG dependencies, added request hedging, and redesigned ad data as column-oriented in memory. The combined effort cut search latency in half, including approximately 120 milliseconds from retrieval, 100-plus from hydration changes, and 130 from ads, while planned product-based search, zero-pass ranking, and streaming target further gains.


### [How Shopify Uses WebAssembly Outside of the Browser](https://yomu.fyi/post/how-shopify-uses-webassembly-outside-of-the-browser.md)
- Company: [Shopify](https://yomu.fyi/company/shopify.md)
- Author: 2023-10-18
- Published: Dec 18, 2020
- Type: Explainer

Shopify describes using WebAssembly (Wasm) outside the browser to run untrusted Partner code on its own infrastructure, reducing partners’ need to operate scalable web services and avoiding network latency for time-sensitive customizations. Wasm provides a sandboxed, stack-based environment with explicit host imports, protected call stacks, and runtime type checking, while targeting near-native performance and multiple source languages. Shopify wraps Fastly’s open-source Lucet runtime and compiler in a Rust web service called the Wasm Engine, which manages module I/O and storage and applies results during runtime processes such as web requests. In a test executing 100,000 modules per minute for roughly five minutes, Lucet execution hovered around 100 μs and total p99 execution time was about 4 ms. Shopify selected AssemblyScript, with TypeScript-like syntax, for first-class developer support and is extending its tooling, SDKs, monitoring, and language support.
