mlscript
mlscript copied to clipboard
The MLscript programming language. Functional and object-oriented; structurally typed and sound; with powerful type inference. Soon to have full interop with TypeScript!
I have not had any time to do this, but several people are already familiar with relevant parts of the code. It would be great if they could contribute some...
How to install all that's needed, run the tests, run tests individually, etc. etc.
Example: ```scala class A this: { x: int } method Foo = this.x // ok class B: A // fine, transfers the `this`-type requirement B{} // error: does not satisfy...
This issue discusses the next code generation. There are several problems with the current code generator. 1. **The current AST is not standard and incomplete.** As the MLscript’s syntax becomes...
The goal is to support precise type inference for the indexing operator `a[i]`. For instance, if `a` turns out to have type `Array`, then `a[0]` should have type `int |...
Internally, traits should use the standard JS mixin inheritance model, as described here: https://justinfagnani.com/2015/12/21/real-mixins-with-javascript-classes/#bettermixinsthroughclassexpressions (Note: TS supports the pattern to some extent but it's very incomplete and hacky: https://www.typescriptlang.org/docs/handbook/mixins.html)
We should not generalize non-function values, which is unsound in the presence of mutation. Also, it would be good to handle all `'a` variables as rigid and have a different...
Currently, this construct can override fields from classes with incompatible types while keeping the class identity (nominal tag). This is sound because the bare identity only informs about runtime instance...
Discovered in c87010fca5f0f2742ab5d56aed7f5831f9af5ad0. ```scala :NoJS class Some[a]: { val: a } method Get: a //│ Defined class Some[+a] //│ Declared Some.Get: Some['a] -> 'a // simplification bug here def g...
The following is currently not simplified: ```scala class Some[A] //│ Defined class Some def f: (Some['A] & 'this) -> (Some['A] & 'this) //│ f: (Some['A] & 'this) -> (Some['A] &...