We should figure out what a good, but basic, standard library we aim for for the first realistically usable programs.
An example of an early class of programs we want to target is a parser. Assuming I/O is taken care of separately, what do we need in the language?
Dart has a well-design standard library we could take inspiration from. Some interfaces and classes we might want:
List<T> - the abstract list indexable interface
- `ArrayList - a list backed by arrays
Array<T> - a non-growable WASM-native array. Note: Do we need growable and non-growable List interfaces? Or should Array not implement List, but some other interface?
Set<T> - interface or class? - should this also be the default hashing-based implementation? It would be nicer to do new Set() than new HashSet().
Map<T> - interface or class?
Collection<T> - nice, but do we need it?
Date - should we even try a simple date, or should we figure out a strategy for using the JavaScript Temporal API via one of the Rust temporal implementation?
Regex - often quite useful for parsers. How do we do this in WASM? https://github.com/google/re2-wasm ?
zena:math - what kind of math functions do we need at first? Trig, min/max/clamp?
Iterator<T> and Iterable<T>
Promise<T>
- some kind of scheduler library we can use for timeouts and intervals
What else?
This issue will be closed by writing an initial design doc sketching out the plan for the standard library, hopefully including priorities and phases.
We should figure out what a good, but basic, standard library we aim for for the first realistically usable programs.
An example of an early class of programs we want to target is a parser. Assuming I/O is taken care of separately, what do we need in the language?
Dart has a well-design standard library we could take inspiration from. Some interfaces and classes we might want:
List<T>- the abstract list indexable interfaceArray<T>- a non-growable WASM-native array. Note: Do we need growable and non-growable List interfaces? Or should Array not implement List, but some other interface?Set<T>- interface or class? - should this also be the default hashing-based implementation? It would be nicer to donew Set()thannew HashSet().Map<T>- interface or class?Collection<T>- nice, but do we need it?Date- should we even try a simple date, or should we figure out a strategy for using the JavaScript Temporal API via one of the Rust temporal implementation?Regex- often quite useful for parsers. How do we do this in WASM? https://github.com/google/re2-wasm ?zena:math- what kind of math functions do we need at first? Trig, min/max/clamp?Iterator<T>andIterable<T>Promise<T>What else?
This issue will be closed by writing an initial design doc sketching out the plan for the standard library, hopefully including priorities and phases.