vjovanov / papers

Papers of Vojin Jovanovic.
http://vjovanov.com
0 stars 0 forks source link

Conversions #10

Open vjovanov opened 9 years ago

vjovanov commented 9 years ago

I do not know how to do promoting inline to dynamic, here is why: How do you convert inline List[inline Tuple2[Int, inline Int]] into a List[Tuple2[Int, Int]]. The problem is that you need to go through the term and delete all inlines :)

Idea: Maybe we need to get rid of the inline t and dynamic t and make the partial evaluator purely type-driven. The sub-typing would take care of the rest I suppose except for promoting static to inline.

densh commented 9 years ago

You can not get rid of inline t as following won't typecheck even if we had ascriptions:

f = inline (x: inline Int) => x
f(2: inline Int)

You can not ascribe term to be of a more specific type.

vjovanov commented 9 years ago

It will, we will add a weak promotion.

densh commented 9 years ago

I don't think that adding implicit promotions to core calculus would make anything simpler. If you don't like evaluation on inline terms just strip them after typechecking and use the types.

vjovanov commented 9 years ago

We need to discuss...

vjovanov commented 9 years ago

Static to inline is the same problem. You just can not promote simply because of nested types. In the implementation I crawl the type-structure and fix it all up. Maybe we simply do not put this in the calculus, for now.