| FazBrowse Wikipedia Viewer | Main Page | | |
| Viewing: https://en.wikipedia.org/wiki/AssemblyScript |
| Contents |
|---|
| Overview |
| Compatibility with JavaScript |
| Use |
| AssemblyScript | |
|---|---|
| Paradigms | Multi-paradigm: functional, generic, imperative, object-oriented |
| Family | ECMAScript: JavaScript: TypeScript |
| Designed by | Daniel Wirtz, Max Graey |
| Developer | The AssemblyScript Project |
| First appeared | 2017;9 years ago (2017) |
| .wasm binary format (object) | |
| Website | www.assemblyscript.org |
| Major implementations | |
OvervieweditIn 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 JavaScripteditAssemblyScript 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). UseeditTurner, 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 | |
| Code analysis | |
| Subsets, supersets | |
| Transpilers | |
| Concepts | |
| Debuggers |
|
| Documentation generators | |
| Engines | |
| Frameworks | |
| Related technologies | |
| Package managers | |
| Module bundlers | |
| Server-side | |
| Unit testing frameworks (list) | |
| People | |
| Client-side | |
|---|---|
| Server-side | |
| Libraries |
| View original on Wikipedia | Back | FazBrowse Home |