Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The State of AssemblyScript 2018

kazupon
December 14, 2018

The State of AssemblyScript 2018

kazupon

December 14, 2018
Tweet

More Decks by kazupon

Other Decks in Programming

Transcript

  1. CTO
 Vue.js Core Team Vue.js japan users group organizer vue-i18n

    author WebAssembly Love ❤ @kazu_pon kazupon kazupon
  2. Kind of allocators • allocator/arena • allocator/tlsf • allocator/buddy •

    allocator/system HEAP_BASE (the first 8 byte aligned offset after static) Static Heap Memory
  3. • 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
  4. • 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
  5. • 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
  6. 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
  7. 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
  8. How to use demangles module Static Heap Memory 32 64

    0x00010000 p1 0x00010008 thisPtr 0x00010000 x y pass the pointer pass the pointer 0x00000000
  9. GC related issues • GC experimentation • GitHub Issue Number:

    #89 • Implement reference counting and/or garbage collection • GitHub Issue Number: #16
  10. Status / Roadmap • Standard library comatibility • TypeScript comatiplity

    • WASM features • Managed object runtime https://next.assemblyscript.org/#/development/roadmap
  11. Closing •AssemblyScript is steadily evolving •Memory management •AssemblyScript loader •GC

    Implementation •It has a potential as WASM app implementation language!