Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The State of AssemblyScript 2018
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
kazupon
December 14, 2018
Programming
1.1k
2
Share
The State of AssemblyScript 2018
kazupon
December 14, 2018
More Decks by kazupon
See All by kazupon
Oxlint JS plugins
kazupon
1
1.3k
gunshi
kazupon
1
190
Nitro v3
kazupon
2
480
わたしのOSS活動
kazupon
3
600
Vapor Revolution
kazupon
3
4.1k
Vue.js最新動向
kazupon
3
1.6k
Vue 3.4
kazupon
13
4.8k
Vue & Vite Rustify
kazupon
4
2.5k
Vue.jsエコシステム動向2023
kazupon
17
9.1k
Other Decks in Programming
See All in Programming
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.6k
RSAが破られる前に知っておきたい 耐量子計算機暗号(PQC)入門 / Intro to PQC: Preparing for the Post-RSA Era
mackey0225
3
120
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
340
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
310
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
520
おれのAgentic Coding 2026/03
tsukasagr
1
140
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
1.7k
The free-lunch guide to idea circularity
hollycummins
0
420
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
270
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
540
Running Swift without an OS
kishikawakatsumi
0
300
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
KATA
mclloyd
PRO
35
15k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Docker and Python
trallard
47
3.8k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
680
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Designing Powerful Visuals for Engaging Learning
tmiket
1
330
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
How GitHub (no longer) Works
holman
316
150k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Transcript
The State of AssemblyScript 2018 Emscripten & WebAssembly Night #6
2018.12.14 @kazupon
Who am I ?
CTO Vue.js Core Team Vue.js japan users group organizer vue-i18n
author WebAssembly Love ❤ @kazu_pon kazupon kazupon
Introduction
Last a year …
https://qiita.com/chikoski/items/d98ed0a98acfa896869f
https://qiita.com/kazupon/items/37e1ee9db0ca5419c517
One year has passed.
During this time, AssemblyScript evolves little by little.
Today Contents About recently updates of AssemblyScript
ATTENTION !! • AssemblyScript v5 is WIP (Not published in
NPM) • It might be changed in future
What is AssemblyScript?
Compile a strictly-typed subset of TypeScript to WebAssembly
Recently updates from last year
Hot topics •Memory management •AssemblyScript loader •GC Implementation
Memory Management
Kind of allocators • allocator/arena • allocator/tlsf • allocator/buddy •
allocator/system HEAP_BASE (the first 8 byte aligned offset after static) Static Heap Memory
• Accumulates memory with no mechanism to free specific segments
allocator/arena Static Allocated memory.allocate(1024) startOffset offset 64KB (page x) Allocatable Heap region Memory
• Simply increase the memory size, when memory size will
be about to fill. allocator/arena Static Allocated memory.allocate(1024) startOffset offset 64KB Memory memory.grow(2) 128KB
• when memory.reset, resets the counting memory offset to its
initial value and starts all over again. allocator/arena Static Heap memory.reset() startOffset offset 128KB Memory 64KB
allocate / free of memory
• You can use your custom memory allocator ! allocator/system
Memory Layout • String e.g. const str: string = ‘Hello’
Memory Layout • Arrays: All arrays store their contents in
an ArrayBuffer behind the scenes.
Memory Layout • ArrayBuffer layout
AssemblyScript loader
What is it? • Provide some APIs of convenient AssemblyScript
modules loading • Demangles module • Exports to a friendly object structure compatible WebIDL and TypeScript definitions for JS env • Some useful utilities as helper API, to read/write data from/to memory
Demangles module structure add Point thisPtr x (getter/setter) y (getter/setter)
add (method) I8 U8 I16 U16 I32 U32 I64 U64 F32 F64 Static Heap WASM module Demangles module Wrap Wrap Return the pointer Memory Ref newString getString … Utilities
How to use demangles module Static Heap Memory 32 64
0x00010000 p1 0x00010008 thisPtr 0x00010000 x y pass the pointer pass the pointer 0x00000000
Working with strings and arrays • ex: object path parser
Reading/writing basic values to/from memory https://github.com/AssemblyScript/assemblyscript/tree/master/lib/loader#readingwriting-basic-values-tofrom-memory Static Heap Memory FF
FF 0x00010000 ptr: 0x00010000 0x00010001 U8 0x00000000 U16
GC implementation
Experimental !! https://github.com/AssemblyScript/assemblyscript/pull/196
Manually GC release
GC related issues • GC experimentation • GitHub Issue Number:
#89 • Implement reference counting and/or garbage collection • GitHub Issue Number: #16
In future …
Status / Roadmap • Standard library comatibility • TypeScript comatiplity
• WASM features • Managed object runtime https://next.assemblyscript.org/#/development/roadmap
Closing
Closing •AssemblyScript is steadily evolving •Memory management •AssemblyScript loader •GC
Implementation •It has a potential as WASM app implementation language!
Thanks!