Oh, that's a really interesting idea. Mostly as a pure static analysis layer or with significant (idiomatic) codegen?
-
-
Replying to @pervognsen
There are three modes of execution: The “compiler” is just a resolver and partial evaluator on top of futures of head normal terms and lazy arrays of additional constraints. There is a slow, simple dynamically typed runtime on top of future<any>.
2 replies 0 retweets 2 likes -
Replying to @TimSweeneyEpic @pervognsen
If you use the static analysis of #1 to drive type refinements and dead code pruning on #2, you can generate C++ code that is exactly a faster version of what the dynamically typed runtime would have done.
2 replies 0 retweets 6 likes -
Replying to @TimSweeneyEpic
I'm intrigued and look forward to seeing how this develops. (Incidentally, I've done a small systems language with integrated C#/VB-style 'dynamic' but where the dynamic descriptor is exactly the compiler's representation of types.)
1 reply 0 retweets 2 likes -
Replying to @pervognsen @TimSweeneyEpic
I've always the latter was the right way to do things. It might be a _little_ different from the compiler's actual representation because the compiler has extra junk that isn't canonical, so I really mean a compiler-like type representation.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
Then you can work with structs in the same style as 'row polymorphism' where you go through a name to offset table but it's still a low level approach.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
Row polymorphism in this context just means that you get a struct descriptor that contains a minimum set of names, and you can project it down to a further subset and pass it on, etc.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
If you have tuple types in addition to struct types, replaces names with logical (not physical!) indices. So this is a nice way of doing structural subtyping combined with nominal subtyping in a systems language.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
I.e. the descriptor are fully reified but there's compiler support for the desugaring so you can write things in a natural style, e.g. foo.x rather than doing the table lookup and pointer math.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
In that language the static subset wasn't an "optimized subset" of the dynamic superset like you're talking about, for practical reasons I just had a bifurcated approach, and it worked well.
1 reply 0 retweets 0 likes
Yes, I’m doing that! And the compiler’s internal representation of types is just identity functions that take a value and either return it or throw an “uninhabited” exception. The partial evaluator then supports two modes, assuming and testing, for typechecking under lambas.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.