This page is no longer maintained — Please continue to the home page at www.scala-lang.org

the AST typing problem

1 reply
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

Lovers of internals may enjoy this thread.

http://lambda-the-ultimate.org/node/4170

spoon
Joined: 2008-07-01,
User offline. Last seen 1 year 21 weeks ago.
Re: the AST typing problem
Yep, good thread!
Two ideas came to me while reading it:
1. Scalac includes AST node constructors that take symbols as arguments, and these are much safer to use after type checking is complete. Would it be reasonable to have a flag in the compiler such that, once type checking is complete, you can *only* use the symboly constructors? I know I've had a lot of trouble writing scalac code due to ASTs that are badly typed. If you use the symbol-based constructors, they tend to add the correct types automatically.
2. I seem to recall a fair amount of code in the compiler that does a check for whether or not erasure has passed. If that's still the case, then it might actually simplify things to have a separate AST for after erasure. How much code is really used polymorphically against both pre- and post-erasure ASTs? How much of that code does not branch based on whether erasure has happened?
Just ideas.
Lex

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland