DylanSp / faust-lang

An experimental language for exploring contract-based programming
MIT License
0 stars 0 forks source link

Design type system #2

Open DylanSp opened 1 year ago

DylanSp commented 1 year ago

Type System Design

Base Types

Description Name in Faust Notes
Booleans bool
Integers int64 Implement with JS BigInt in interpreter
Double-precision floating-point fp64 Implement with JS Number in interpreter
Strings str Required to be ASCII, but treated as an opaque type - Faust doesn't have a char type. See notes in roadmap
Void/Unit type void Return type for functions that don't return a value

Other Types

Generics

Structs, tuples, enums, and arrays can all be generic, taking some number of type parameters.

Notable omissions

DylanSp commented 1 year ago

Omissions for Stage 1

Not included now, but will probably be implemented later.

DylanSp commented 1 year ago

Open question: should I expose fixed-length arrays to Faust users? Would it be possible to only expose an equivalent to C++'s std::vector<T> to users, and have fixed-length arrays only be allowed within the implementation of that type?