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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The State of AssemblyScript 2018
kazupon
December 14, 2018
More Decks by kazupon
See All by kazupon
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
630
Oxlint JS plugins
kazupon
1
1.3k
gunshi
kazupon
1
230
Nitro v3
kazupon
2
550
わたしのOSS活動
kazupon
3
620
Vapor Revolution
kazupon
3
4.2k
Vue.js最新動向
kazupon
3
1.6k
Vue 3.4
kazupon
13
4.9k
Vue & Vite Rustify
kazupon
4
2.5k
Other Decks in Programming
See All in Programming
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2k
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
130
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
210
Lessons from Spec-Driven Development
simas
PRO
0
170
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
710
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
160
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
2k
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3.2k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
880
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
500
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.6k
Modding RubyKaigi for Myself
yui_knk
0
920
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
How to Think Like a Performance Engineer
csswizardry
28
2.6k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
470
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.2k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
410
How STYLIGHT went responsive
nonsquared
100
6.2k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
360
Color Theory Basics | Prateek | Gurzu
gurzu
0
360
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Design in an AI World
tapps
1
240
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!