6 ms·
FYI, AssemblyScript is a TypeScript variant targeted to WASM. If someone would ask why you want to use another JS to use WASM, it is not a scripting language. A
by kbumsik 6y ago
FYI, AssemblyScript is a TypeScript variant targeted to WASM. If someone would ask why you want to use another JS to use WASM, it is not a scripting language. AssemblyScript produces WASM binaries with minial runtimes so its WASM binary size is very small, even smaller than C outputs (with Emscripten) most of times.
So if you want to write a low-level WASM code in WebAssembly text format (WAT), it is probably a good idea to use AssemblyScript instead.
- wizzwizz4 6y agoAssemblyScript is a tiny subset of TypeScript; it's probably better to describe it as a C-like compiled language that borrows syntax from TypeScript.
- maxgraey 6y agoNot only syntax, but also standard library, ecosystem and etc. You could easily transpile AssemblyScript project to JavaScript via tsc if use portable glue code. From C it I guess it borrows AOT compilation, ability to use low-level intrinsics and more granular and sound types. Btw many people still thought AS has manual memory management, but it's not true. By default it use hybrid ARC and GC approach called PureRC: https://github.com/dcodeIO/purerc/blob/master/papers/Bacon03Pure.pdf https://github.com/dcodeIO/purerc/blob/master/papers/Bacon03...
- wizzwizz4 6y agoYou can easily transpile any C-syntax subset into C, if you use the right libraries. Same with Python, or Java, or MIT Scratch, or any other language I can think of.
- remram 6y agoSo we're on our way to finish the re-creation of Java, by unifying the JavaScript and foreign code into a single bytecode format. Honestly I'm all for it, and wouldn't change much since most JavaScript written today goes through compilation anyway (TypeScript and/or Babel). Only executing bytecode and taking out JavaScript parsers/interpreters would simplify browser implementations too. Just... what a roundabout trip it has been.
- overgard 6y agoI suppose it is, but Java applets never took off because they were horrible. Half the time they wouldn't work, and when they did they never felt like they were part of a page, and generally felt bloated and slow. Much more like a bad version of Flash than something that felt like part of a page.
- The_rationalist 6y agoThis implementation detail issue could be solved by integrating graalvm in the browser and with the DOM
- krapp 6y agoThere are plenty of languages other than this AssemblyScript that compile to Webassembly whereas only Java code compiled to Java bytecode. It's no more another Java than another C or Lua or any other language that just happens compiles to a binary or bytecode.
- kabes 6y agoA lot of languages compile to java bytecode. https://en.m.wikipedia.org/wiki/List_of_JVM_languages https://en.m.wikipedia.org/wiki/List_of_JVM_languages
- appleflaxen 6y agothat description should be on their front page; it communicates the concept more clearly than "A language made for WebAssembly" IMO