Skip to content

Status and Roadmap

Congcong Cai edited this page Nov 2, 2024 Β· 167 revisions

High level status

  • Most of TypeScript's AOT-compatible syntax is supported
  • A managed runtime takes care of memory management and GC
  • Classes are more like C-structs with methods (no virtual overloads yet)
  • Standard library is functional but still needs more work
  • Throwing an exception terminates the entire program (needs WebAssembly/exception-handling)
  • We need more tests (pretty sure this will remain here)

High level goals

  • Get a memory manager and GC combo up and running
    • Memory manager (TLSF)
    • Automatic reference counting & garbage collection (PureRC)
  • Get a working standard library up (where AOT-compatible)
  • Improve linking, e.g. with C, based on what's supported by common tools
  • Compile the AssemblyScript compiler to WebAssembly using itself
  • Provide tools to automatically generate glue code and definitions

And, of course, keep up with the state of WebAssembly, most notably at this point:

Proposal Phase Status
Sign Extension Operations standardized --enable sign-extension
Mutable Globals standardized --enable mutable-global
Non-trapping float-to-int Conversions standardized --enable nontrapping-f2i
Bulk Memory Operations standardized --enable bulk-memory
Reference Types standardized --enable reference-types
Multi-Value standardized
SIMD implementation --enable simd
Threads implementation --enable threads
Tail Call implementation
Exception Handling implementation
Function References proposal
Interface Types proposal
Memory64 proposal
Wasm GC proposal

Standard library compatibility

AssemblyScript comes with its own lightweight standard library that aims to be as compatible as it can get to what you'd expect in the browser. The following table outlines what's implemented already:

Feature Notes

Globals

NaN βœ“ Context-sensitive (f32 in f32 context, otherwise f64)
Infinity βœ“ Context-sensitive (f32 in f32 context, otherwise f64)
isFinite βœ“
isNaN βœ“
parseFloat βœ“
parseInt βœ“
decodeURI βœ“
decodeURIComponent βœ“
encodeURI βœ“
encodeURIComponent βœ“

Number

There is no Number object in AssemblyScript, but one for each type instead.
EPSILON βœ“
MIN_VALUE βœ“
MAX_VALUE βœ“
MIN_NORMAL_VALUE βœ“ AssemblyScript specific
MIN_SAFE_INTEGER βœ“
MAX_SAFE_INTEGER βœ“
NaN βœ“
NEGATIVE_INFINITY βœ“
POSITIVE_INFINITY βœ“
isFinite βœ“
isInteger βœ“
isNaN βœ“
isSafeInteger βœ“
parseFloat βœ“
parseInt βœ“
toExponential
toFixed
toLocaleString
toPrecision
toString βœ“

Array

length βœ“
at βœ“
from
isArray βœ“
of
concat βœ“
copyWithin βœ“
entries
every βœ“ No closures yet
fill βœ“
filter βœ“ No closures yet
find
findLast
findIndex βœ“ No closures yet
findLastIndex βœ“ No closures yet
flat βœ“ Partially
flatMap
forEach βœ“ No closures yet
includes βœ“
indexOf βœ“
join βœ“
keys
lastIndexOf βœ“
map βœ“ No closures yet
pop βœ“
push βœ“
reduce βœ“ No closures yet
reduceRight βœ“ No closures yet
reverse βœ“
shift βœ“
slice βœ“
some βœ“ No closures yet
sort βœ“
splice βœ“ Partially implement without inserting items
toLocaleString
toString βœ“
unshift βœ“
values
groupToMap Stage 3
[Symbol.iterator]

TypedArray

BYTES_PER_ELEMENT βœ“
at βœ“
buffer βœ“
byteLength βœ“
byteOffset βœ“
length βœ“
from
of
copyWithin βœ“
entries
every βœ“ No closures yet
fill βœ“
filter βœ“ No closures yet
find
findLast
findIndex βœ“ No closures yet
findLastIndex βœ“ No closures yet
forEach βœ“ No closures yet
includes βœ“
indexOf βœ“
join βœ“
keys
lastIndexOf βœ“
map βœ“ No closures yet
reduce βœ“ No closures yet
reduceRight βœ“ No closures yet
reverse βœ“
set βœ“
slice βœ“
some βœ“ No closures yet
sort βœ“
subarray βœ“
toLocaleString
toString βœ“
values
[Symbol.iterator]

ArrayBuffer

βœ“
byteLength βœ“
isView βœ“
slice βœ“
toString βœ“

DataView

βœ“
buffer βœ“
byteLength βœ“
byteOffset βœ“
getInt8 βœ“
getUint8 βœ“
getInt16 βœ“
getUint16 βœ“
getInt32 βœ“
getUint32 βœ“
getInt64 βœ“ AssemblyScript specific
getUint64 βœ“ AssemblyScript specific
getBigInt64 Required BigInt
getBigUint64 Required BigInt
getFloat32 βœ“
getFloat64 βœ“
setInt8 βœ“
setUint8 βœ“
setInt16 βœ“
setUint16 βœ“
setInt32 βœ“
setUint32 βœ“
setInt64 βœ“ AssemblyScript specific
setUint64 βœ“ AssemblyScript specific
setBigInt64 Required BigInt
setBigUint64 Required BigInt
setFloat32 βœ“
setFloat64 βœ“
toString βœ“

String

length βœ“
fromCharCode βœ“
fromCharCodes βœ“ AssemblyScript specific
fromCodePoint βœ“
fromCodePoints βœ“ AssemblyScript specific
UTF8 βœ“ AssemblyScript specific (See docs)
UTF16 βœ“ AssemblyScript specific (See docs)
dedent Stage 2
at βœ“
charAt βœ“
charCodeAt βœ“
concat βœ“
endsWith βœ“
includes βœ“
indexOf βœ“
lastIndexOf βœ“
localeCompare βœ“ Very basic. Without locales and options
match
matchAll
normalize
padEnd βœ“
padStart βœ“
repeat βœ“
replace βœ“ Without Regexp and callback yet
replaceAll βœ“
search
slice βœ“
split βœ“ Without Regexp
startsWith βœ“
substr βœ“
substring βœ“
toLocaleLowerCase
toLocaleUpperCase
toLowerCase βœ“
toUpperCase βœ“
toString βœ“
trim βœ“
trimLeft/trimStart βœ“
trimRight/trimEnd βœ“
[Symbol.iterator]
raw

Symbol

βœ“
hasInstance βœ“
isConcatSpreadable βœ“
isRegExp βœ“
match βœ“
replace βœ“
search βœ“
species βœ“
split βœ“
toPrimitive βœ“
toStringTag βœ“
unscopables βœ“
for βœ“
keyFor βœ“
toString βœ“

Math

βœ“ This also applies to specific Mathf (single float point) version of Math
E βœ“
LN10 βœ“
LN2 βœ“
LOG10E βœ“
LOG2E βœ“
PI βœ“
SQRT1_2 βœ“
SQRT2 βœ“
sincos_sin βœ“ AssemblyScript specific
sincos_cos βœ“ AssemblyScript specific
abs βœ“
acos βœ“
acosh βœ“
asin βœ“
asinh βœ“
atan βœ“
atan2 βœ“
atanh βœ“
cbrt βœ“
ceil βœ“
clz32 βœ“ Just for compatibility. Not recommended.
cos βœ“
cosh βœ“
exp βœ“
exp2 βœ“ AssemblyScript specific
expm1 βœ“
floor βœ“
fround βœ“
hypot βœ“
imul βœ“ Just for compatibility. Not recommended.
log βœ“
log10 βœ“
log1p βœ“
log2 βœ“
max βœ“
min βœ“
pow βœ“
random βœ“
seedRandom βœ“ AssemblyScript specific
round βœ“
sign βœ“
signbit βœ“ Stage 1 Proposal
sin βœ“
sincos βœ“ AssemblyScript specific
sinh βœ“
sqrt βœ“
tan βœ“
tanh βœ“
trunc βœ“

Map

size βœ“
clear βœ“
delete βœ“
entries
emplace Stage 2 proposal
forEach
get βœ“
has βœ“
set βœ“
keys βœ“ Return array instead iterator currently
values βœ“ Return array instead iterator currently
toString βœ“
[Symbol.iterator]

Set

size βœ“
add βœ“
clear βœ“
delete βœ“
difference Stage 3 Proposal
entries
forEach
has βœ“
intersection Stage 3 Proposal
isDisjointFrom Stage 3 Proposal
isSubsetOf Stage 3 Proposal
isSupersetOf Stage 3 Proposal
union Stage 3 Proposal
symmetricDifference Stage 3 Proposal
values βœ“ Return array instead iterator currently
toString βœ“
[Symbol.iterator]

WeakMap

delete
get
has
set
toString

WeakSet

add
delete
has
toString

Console

assert
clear
count
countReset
dir
error
group
groupCollapsed
groupEnd
info
log
table
time
timeEnd
trace
warn

JSON

parse
stringify

Object

is βœ“
keys
assign
create
entries
getOwnPropertyNames
getOwnPropertySymbols
toString
values

Date

UTC βœ“
now βœ“
parse βœ“ Only for ISO format
getDate
getDay
getFullYear
getHours
getMilliseconds
getMinutes
getMonth
getSeconds
getTime βœ“
getTimezoneOffset
getUTCDate βœ“
getUTCDay βœ“
getUTCFullYear βœ“
getUTCHours βœ“
getUTCMilliseconds βœ“
getUTCMinutes βœ“
getUTCMonth βœ“
getUTCSeconds βœ“
setDate
setFullYear
setHours
setMilliseconds
setMinutes
setMonth
setSeconds
setTime βœ“
setUTCDate βœ“
setUTCFullYear βœ“
setUTCHours βœ“
setUTCMilliseconds βœ“
setUTCMinutes βœ“
setUTCMonth βœ“
setUTCSeconds βœ“
toDateString βœ“
toISOString βœ“
toJSON
toLocaleDateString
toLocaleString
toLocaleTimeString
toString βœ“ Without timezone and local offset
toTimeString βœ“ Without timezone and local offset
toUTCString βœ“

Error

message βœ“
name βœ“
stack
toString βœ“

Iterator / AsyncIterator

drop Iterator helpers proposal (Stage 2)
every Iterator helpers proposal (Stage 2)
from Iterator helpers proposal (Stage 2)
filter Iterator helpers proposal (Stage 2)
find Iterator helpers proposal (Stage 2)
flatMap Iterator helpers proposal (Stage 2)
forEach Iterator helpers proposal (Stage 2)
indexed Iterator helpers proposal (Stage 2)
map Iterator helpers proposal (Stage 2)
next
reduce Iterator helpers proposal (Stage 2)
return
take Iterator helpers proposal (Stage 2)
throw
toAsync Iterator helpers proposal (Stage 2)
toArray Iterator helpers proposal (Stage 2)
some Iterator helpers proposal (Stage 2)

Promise

all
allSettled
any
race
reject
resolve
catch
finally
then

RegExp

lastIndex
dotAll
flags
global
ignoreCase
multiline
source
sticky
unicode
exec
test
toString
[Symbol.replace]
[Symbol.search]
[Symbol.split]

Atomics

βœ“
add βœ“
and βœ“
compareExchange βœ“
exchange βœ“
fence βœ“
isLockFree βœ“
load βœ“
notify βœ“
or βœ“
store βœ“
sub βœ“
wait βœ“
wake βœ“
xor βœ“

SIMD (v128)

βœ“
const βœ“
splat βœ“
extract_lane(_u/_s) βœ“
replace_lane βœ“
shuffle βœ“
swizzle βœ“
add βœ“
sub βœ“
mul βœ“
neg βœ“
add_sat_(u/s) βœ“
sub_sat_(u/s) βœ“
shl βœ“
shr_(u/s) βœ“
and βœ“
or βœ“
xor βœ“
not βœ“
andnot βœ“
bitselect βœ“
any_true βœ“
all_true βœ“
bitmask βœ“ Only i8x16/i16x8/i32x4
eq βœ“
ne βœ“
lt(_u/_s) βœ“
le(_u/_s) βœ“
gt(_u/_s) βœ“
ge(_u/_s) βœ“
load βœ“
load_lane βœ“
load_splat βœ“
load_zero βœ“
load8x8_(u/s) βœ“
load16x4_(u/s) βœ“
load32x2_(u/s) βœ“
store βœ“
store_lane βœ“
abs βœ“
min_(s/u) βœ“ except i64x2
max_(s/u) βœ“ except i64x2
min βœ“ Only f32x4/f64x2
max βœ“ Only f32x4/f64x2
pmin βœ“ Only f32x4/f64x2
pmax βœ“ Only f32x4/f64x2
ceil βœ“ Only f32x4/f64x2
floor βœ“ Only f32x4/f64x2
trunc βœ“ Only f32x4/f64x2
nearest βœ“ Only f32x4/f64x2
dot βœ“ Only i16x8
avgr_u βœ“ Only i8x16/i16x8
div βœ“ Only f32x4/f64x2
sqrt βœ“ Only f32x4/f64x2
convert_(u/s) βœ“
convert_low βœ“
trunc_sat_(s/u) βœ“
trunc_sat_(s/u)_zero βœ“
narrow_(u/s) βœ“
extend_low βœ“
extend_high βœ“
extadd_pairwise_(u/s) βœ“ Only i8x16/i16x8
extmul_low_(u/s) βœ“
extmul_high_(u/s) βœ“
demote_zero βœ“ Only f64x2
promote_low βœ“ Only f32x4
q15mulr_sat βœ“ Only i16x8

BigInt

BigInt(str)
BigInt(num)
i32(bn), u32(bn)
i64(bn), u64(bn)
f64(bn), f32(bn)
asIntN
asUintN
!a
-a
~a
a++
a--
a & b
a | b
a ^ b
a + b
a - b
a * b
a / b
a % b
a ** b
a << b
a >> b
a >>> b
a == b
a != b
a > b
a < b
a >= b
a <= b
toLocaleString
toString