On Fri, Jun 12, 2015 at 1:18 AM, Keean Schupke <[email protected]> wrote:
> On 12 Jun 2015 08:57, "Matt Oliveri" <[email protected]> wrote: > > On Fri, Jun 12, 2015 at 2:43 AM, Keean Schupke <[email protected]> wrote: > > > What do you mean by a typed AST? > > > > Sorry. I mean having multiple AST types, approximately one per CFG > nonterminal. > > > Keean, the goal here is not to improve performance over the > > one-big-tagged-union option. It is indeed clear that you can't do > > better, if you want AST nodes to be useful. The goal is to know, > > statically, that the parsed AST will always conform to the constrained > > structure allowed by the original CFG. > > Okay, I see. Can we always encode the CFG in the compiler host > type-system? What if well-typedness depends on intersection or linear > types, or some other sub-structural type system that is not expressible in > the host type-system? > It depends on the host type system, of course. Different host languages support type checking in different degree. The work on Zephyr/ASDL suggests that you can do quite well in practice in all of the languages we care about. > Can we not rely on being well-typed by construction? > It would be good to do better than that. Think about the jumble of non-exhaustive CASE statements that will arise in the AST walker. shap
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
