FazBrowse Wikipedia Viewer | Main Page |
Search Wikipedia:
|
Viewing: https://en.wikipedia.org/wiki/AssemblyScript

AssemblyScript

Contents
Overview
Compatibility with JavaScript
Use

"},"screenshot caption":{"wt":""},"paradigms":{"wt":"[[Multi-paradigm programming language|Multi-paradigm]]: [[Functional programming|functional]], [[Generic programming|generic]], [[Imperative programming|imperative]], [[Object-oriented programming|object-oriented]]"},"family":{"wt":"[[ECMAScript]]: [[JavaScript]]: [[TypeScript]]"},"designer":{"wt":"Daniel Wirtz,<ref name=\"as-wg\">{{cite web|url=https://github.com/AssemblyScript/working-group|title=AssemblyScript Working Group|author=<!--Human name(s)-->|date=2020-04-24|website=GitHub.com|publisher=AssemblyScript Project|access-date=2021-02-10|quote=Daniel Wirtz (@dcodeIO) - Author of AssemblyScript}}</ref> Max Graey<ref>{{cite web|url=https://www.youtube.com/watch?v=ZlL1nduatZQ|title=WebAssembly for Javascript Developers|last1=Turner|first1=Aaron|date=March 28, 2019|website=YouTube.com|publisher=WebAssembly SF|access-date=2021-02-10|quote=@dcodeIO [Daniel Wirtz] and @MaxGraey [Max Graey]—they’re the main two developers of AssemblyScript}}</ref>"},"developer":{"wt":"The AssemblyScript Project<ref name=\"as-wg\"/>"},"released":{"wt":"{{Start date and age|2017}}<ref>{{cite web|url=https://www.npmjs.com/package/assemblyscript/v/0.1.0|title=assemblyscript 0.1.0|author=<!--Human name(s)-->|date=2017|website=npmjs.com|publisher=AssemblyScript Project|access-date=2021-02-10}}</ref>"},"latest release version":{"wt":"{{wikidata|property|preferred|references|edit|Q105690185|P348|P548=Q2804309}}"},"latest release date":{"wt":"{{Start date and age|{{wikidata|qualifier|preferred|single|Q105690185|P348|P548=Q2804309|P577}}}}"},"latest preview version":{"wt":"<!-- N/A; is rolling-release schedule -->"},"latest preview date":{"wt":"<!-- {{Start date and age|202y|mm|dd|df=no}} -->"},"typing":{"wt":"[[Type system#Static type checking|Static]]"},"scope":{"wt":"[[Scope (computer science)#Lexical scope vs. dynamic scope|Lexical]]"},"programming language":{"wt":""},"platform":{"wt":""},"operating system":{"wt":""},"license":{"wt":"[[Apache License|Apache 2.0]]<ref>{{cite web |url=https://github.com/AssemblyScript/assemblyscript/blob/master/LICENSE|title=License|author=<!--Human name(s)-->|date=2017-09-29|website=GitHub.com|publisher=The AssemblyScript Project|access-date=2021-02-10|quote=AssemblyScript/assemblyscript is licensed under the Apache License 2.0}}</ref>"},"file ext":{"wt":"{{mono|.ts}}"},"file format":{"wt":"[[text file|text]], [[Unicode]] (source)<br/>[[WebAssembly#Code representation|{{mono|.wasm}} binary format]] (object)"},"website":{"wt":"{{URL|www.assemblyscript.org}}"},"implementations":{"wt":"{{mono|asc}} (AssemblyScript compiler)"},"dialects":{"wt":""},"influenced by":{"wt":"[[JavaScript]], [[TypeScript]], [[WebAssembly]]"},"influenced":{"wt":""}},"i":0}}]}'>
AssemblyScript
ParadigmsMulti-paradigm: functional, generic, imperative, object-oriented
FamilyECMAScript: JavaScript: TypeScript
Designed byDaniel Wirtz, Max Graey
DeveloperThe AssemblyScript Project
First appeared2017;9 years ago (2017)
.wasm binary format (object)
Websitewww.assemblyscript.org
Major implementations

Overview

edit

In 2017, the availability of support for WebAssembly, a standard definition for a low-level bytecode and an associated virtual machine, became widespread among major web browsers, providing web programs a lower-level and potentially higher-performance compiling target for client-side programs and applications to execute within web browsers, along with the interpreted (and in practice dynamically compiled) JavaScript web scripting language. WebAssembly allows programs and code to be statically compiled ahead of time in order to run at potentially native-level or bare machine (metal) performance within web browsers, without the overhead of interpretation or the initial latency of dynamic compilation.

With the adoption of WebAssembly in major web browsers, Alon Zakai, creator of Emscripten, an LLVM–Clang-based C and C++ compiler that targeted a subset of JavaScript named asm.js, added support for WebAssembly as a compiling target in Emscripten, allowing C and/or C++ programs and code to be compiled directly to WebAssembly.

While Emscripten and similar compilers allow writing new code, or porting extant code, written in a high-level programming language such as C, C++, Go, and Rust to WebAssembly to achieve potentially higher, native-level execution performance in web browsers, this forces web developers accustomed to developing client-side web scripts and applications in ECMAScript–JavaScript (the de facto client-side programming language in web browsers) to use a different language to target WebAssembly than JavaScript. AssemblyScript, as a variant of TypeScript that is syntactically similar to JavaScript, allows developers accustomed to JavaScript to use a familiar language to target WebAssembly, potentially reducing the learning curve of a separate language that can be compiled to WebAssembly. Also, because AssemblyScript was designed to be an optimal source language for WebAssembly, the language's type system closely reflects that of WebAssembly, and the language provides standard low-level functions (typically implemented as macros) that map directly to WebAssembly instructions that mirror instructions available on modern processors such as single instruction, multiple data (SIMD) and vector instructions and more specialized instructions such as clz (count leading zero bits), ctz (count trailing zero bits), and popcnt (population count), used in applications such as encryption and cryptographic libraries.

asc compiler and other tooling are available via the npm package manager.

While WebAssembly was originally designed for execution within web browsers, the development of WASI (WebAssembly System Interface), a community specification for a standard API that allows WebAssembly programs access to system calls and other operating system functions, has led to the development of WebAssembly runtime environments from projects such as Wasmtime [d], WebAssembly Micro Runtime [d], Wasmer [d], WasmEdge [d] and wazero [d] that allow WebAssembly, and code written in languages such as AssemblyScript that can compile to it, to run in non-web environments as well.

Compatibility with JavaScript

edit

AssemblyScript is compiled to WebAssembly modules, which can then be instantiated into client-side Web pages using standard JavaScript methods such as WebAssembly.compileStreaming and WebAssembly.instantiateStreaming just like standard WebAssembly binaries. Data passing between JavaScript and the compiled WebAssembly modules, as well as function calls between JavaScript and WebAssembly, are then the same as for any WebAssembly module.

Because the AssemblyScript language is mostly a subset of TypeScript, it is theoretically possible to write an AssemblyScript program using this subset and compile it to both plain JavaScript and WebAssembly, using the TypeScript compiler and AssemblyScript compiler, respectively. This potentially allows portable code that can be used in either JavaScript or WebAssembly runtime systems (environments).

Use

edit

Turner, Aaron (March 28, 2019). "WebAssembly for Javascript Developers". YouTube.com. WebAssembly SF. Retrieved February 10, 2021. @dcodeIO [Daniel Wirtz] and @MaxGraey [Max Graey]—they're the main two developers of AssemblyScript

  • ↑ "License". GitHub.com. The AssemblyScript Project. September 29, 2017. Retrieved February 10, 2021. AssemblyScript/assemblyscript is licensed under the Apache License 2.0
  • ↑ "},"website":{"wt":"GitHub.com"},"publisher":{"wt":"The AssemblyScript Project"},"access-date":{"wt":"2021-02-10"}},"i":0}}]}'/>"The AssemblyScript Project". GitHub.com. The AssemblyScript Project. Retrieved February 10, 2021.
  • ↑ "},"date":{"wt":"November 2017"},"work":{"wt":"WebAssembly.org"},"publisher":{"wt":"WebAssembly Community Group"},"access-date":{"wt":"2021-02-10"}},"i":0}}]}'/>"Roadmap". WebAssembly.org. WebAssembly Community Group. November 2017. Retrieved February 10, 2021.
  • ↑ "Types". AssemblyScript.org. The AssemblyScript Project. Retrieved February 10, 2021.
  • ↑ "},"work":{"wt":"AssemblyScript.org"},"publisher":{"wt":"The AssemblyScript Project"},"access-date":{"wt":"2012-02-10"}},"i":0}}]}'/>"Environment". AssemblyScript.org. The AssemblyScript Project. Retrieved February 10, 2012.
  • ↑ Wasmer, Inc. "Wasmer: The Universal WebAssembly Runtime". Wasmer.io. Wasmer, Inc. Retrieved February 10, 2021.
  • ↑ Mozilla Developer Network. "Using the WebAssembly JavaScript API". developer.mozilla.org. Mozilla Developer Network. Retrieved February 10, 2021.
  • ↑ "},"website":{"wt":"GitHub.com"},"publisher":{"wt":"[[GitHub]]"},"access-date":{"wt":"2025-05-26"}},"i":0}}]}'/>"AssemblyScript/assemblyscript Dependency graph". GitHub.com. GitHub. Retrieved May 26, 2025.
  • ↑ Alon Zakai (February 19, 2020). "Shipping Tiny WebAssembly Builds". YouTube.com. WebAssembly-Summit.org. Retrieved February 10, 2021.
  • ↑ Official website
  • AssemblyScript on GitHub
  • AssemblyScript documentation (project page)
  • assemblyscript (on npm)
  • Code analysis
    Subsets, supersets
    Transpilers
    Concepts
    Debuggers
    Documentation generators
    Engines
    Frameworks
    Related technologies
    Package managers
    Module bundlers
    Server-side
    Unit testing frameworks (list)
    People
    ECMAScript
    Dialects
    Engines
    Frameworks
    Client-side
    Server-side
    Libraries
    People
    Other
    Lists: Alphabetical
  • Categorical
  • Generational
  • Non-English-based

  • View original on Wikipedia | Back | FazBrowse Home