VOOZH about

URL: https://thenewstack.io/how-typescript-can-speed-up-your-adoption-of-webassembly/

⇱ How TypeScript Can Speed up Your Adoption of WebAssembly - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-01-14 05:00:23
How TypeScript Can Speed up Your Adoption of WebAssembly
feature,
Cloud Native Ecosystem / Open Source / Software Development

How TypeScript Can Speed up Your Adoption of WebAssembly

AssemblyScript, a variant of TypeScript, can help eliminate some hurdles for web developers who want to start using WebAssembly.
Jan 14th, 2022 5:00am by Divya Mohan
👁 Featued image for: How TypeScript Can Speed up Your Adoption of WebAssembly

WebAssembly, also known as WASM, is being touted as one of the top cloud native trends to watch out for in 2022. WASM — a fast, secure and powerful way to run code across a variety of platforms — bears an uncanny resemblance to container runtimes. A number of projects and startups are working on accelerating its adoption.

The technology is relatively new — it was first released just under five years ago. So there’s still a lot of work being done to improve the toolchain setup, as Fintan Ryan, a senior analyst at Gartner, noted in a previous New Stack article.

The newness of WASM, and the rapid innovation around it could feel daunting to those from the web developer background, However, knowledge of TypeScript, a strongly typed language building on JavaScript, might just make taking those first steps a little less intimidating.

The Complexities of WebAssembly

JavaScript wasn’t designed to be a compilation target for the web. Owing to its ubiquity and lower entry-level barrier for adoption, it ended up becoming one. But JavaScript brings with it some pitfalls.

Although portable and fast, the performance of JavaScript was unpredictable when it came to complex web applications. This paved the way for efforts to design a compilation target for the web that was fast, secure, portable and enabled high performance — and for standardizing those efforts.

Enter WebAssembly. With a bytecode format and an associated text code format that could be used by virtually every browser irrespective of the platform as a compilation target, it won on almost all these fronts.

But one look at the compiled code was enough to intimidate programmers, because it lacked all the high-level abstractions that a programming language offered. While its purpose was not to be manually written, since it was designed to be a compilation target, adopters did need to learn one of the languages that could compile to WASM.

While compilers were developed for typed languages like C, C++, and Rust, those without a type system like JavaScript were left behind, owing to the fact that WASM itself was statically typed.

It was only in 2017 that AssemblyScript made its way into the ecosystem and eliminated the need for web devs to learn a new language altogether if they wanted to harness the benefits of WASM.

What Is AssemblyScript?

A variant of TypeScript, AssemblyScript targets the WASM feature set and allows programmers to have low-level control over their code. Like TypeScript, AssemblyScript is also open source.

The documentation for AssemblyScript states, “Unlike TypeScript, which targets a JavaScript environment with all of its dynamic features, AssemblyScript targets WebAssembly with all of its static guarantees, hence intentionally avoids the dynamicness of JavaScript where it cannot be compiled ahead of time efficiently.”

Unlike TypeScript that compiles to JavaScript, AssemblyScript is compiled to WebAssembly directly by Binaryen, correlating to higher speed and performance.

How Does AssemblyScript Help?

If JavaScript is your preferred programming language, TypeScript is pretty much its superset, with an addition of optional static typing while remaining syntactically similar. AssemblyScript, as mentioned previously, is a stricter variant of TypeScript which means that there isn’t a requirement to start from scratch and adopters are therefore able to build upon existing knowledge.

“TypeScript, the statically typed variant of JavaScript, is a widely adopted and easy to understand type safety system for web apps,” Connor Hicks, founder and CEO of the serverless engine company Suborbital, told The New Stack.

“Since WebAssembly is very strongly typed, it made a lot of sense to create a language using TypeScript syntax for web developers to easily build with WASM,” Hicks said. “AssemblyScript is one of the easiest ways for developers to use a familiar language while getting the performance and portability benefits of WebAssembly”

However, even though it bears some similarities to TypeScript, AssemblyScript should not be mistaken as a subset of it. Behavioral and feature-specific surprises need to be accounted for because, after all, they are compiling to two very different targets.

A quick glance at the documentation is enough to understand that the features making JavaScript (and TypeScript) a favorite among web devs have been stripped off when it comes to the development of AssemblyScript.

Whether that means the absence of common operators like any, void, and undefined or of DOM access due to WebAssembly modules running in sandboxes, there is definitely a lot of cultural and mindset shift that accompanies the adoption of AssemblyScript (and WebAssembly).

With greater maturity, some important features of TypeScript, like closure support for all functions, will likely get incorporated into AssemblyScript. However, one must remember that while familiarity with TypeScript could be a stepping stone towards WebAssembly adoption via AssemblyScript, keep in mind that AssemblyScript is not an exact subset of TypeScript.

Because it was tailor-made for WebAssembly, AssemblyScript’s evolution will be tied to the ways in which WebAssembly specifications develop. If you know Typescript, there’s much to build upon in the syntactic similarities between that and AssemblyScript — but the latter is writing a brand new story with elements of a familiar language.

TRENDING STORIES
An open source enthusiast, Divya Mohan currently leads the web technologies production support team at HSBC. She co-chairs the documentation efforts for two open source projects: LitmusChaos and Kubernetes. Divya is also a Cloud Native Computing Foundation ambassador and has...
Read more from Divya Mohan
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.