Language considerations
Shopify Functions support any language that compiles to WebAssembly (Wasm), such as Rust, AssemblyScript, or TinyGo. Functions that are compiled to Wasm need to meet our WebAssembly API specifications (including WASI), and our platform binary and performance limitations.
This guide introduces the language support and tooling that's available in Shopify Functions.
Functions environment
Anchor link to section titled "Functions environment"Shopify Functions operates in critical buyer flows such as Checkout. For a given Checkout request there may be multiple functions executed, each one adding to the overall latency of the checkout request. For this reason, Shopify places a number of platform limits, many of which can be measured locally using Shopify CLI.
Choosing a language
Anchor link to section titled "Choosing a language"Languages that compile directly to WebAssembly, such as Rust, perform better than dynamic languages, such as JavaScript. If your function targets a public app, expects to operate on a large number of line items, or is computationally complex, then choose Rust to stay within the Shopify Functions instruction count requirements.
For prototyping ideas, JavaScript is a good starting point if you're familiar with the language. However, expect to run into instruction limits sooner than if you wrote the equivalent function logic in a language that compiles to WebAssembly directly, such as Rust.
Available language support
Anchor link to section titled "Available language support"- Learn about how data is input to and output from Shopify Functions.
- Explore the references for each Function API.
- Get familiar with testing and debugging practices that pertain to Shopify Functions.