[M3devel] typenames vs. lexical scope vs. backend?
Jay K
jay.krell at cornell.edu
Mon Oct 25 02:15:46 CEST 2010
> No different from names of variables, formals, constants, or procedures.
> I can't think why the backend would need them for code generation/optimization.
For debugging.
> They do belong in debug info, however.
Exactly. Maybe.
Except, I'm thinking..maybe only for entering expressions with casts?
Maybe not for viewing any values?
I think the way the compiler is currently structured, it is a lot of work to get this right,
and not with much gain.
The gain would be that typenames in expressions with casts would be 1) evaluated
relative to context 2) easier...typenames should probably be lengthened
in order to have a context-independent name. The lexical scopes
that introduce type names, in order of decreasing frequency would be roughly:
module
toplevel function in a module
block or nested function
We could qualify typenames with Module or Module.Function or Module.Function.NestedFunction.
There's no obvious good name for blocks (WITH, FOR, etc.), but maybe numbers 0, 1, 2, etc.
I think the frontend and frontend/backend interface need work.
In this case there's not much to gain.
I'll cover something else in a separate mail.
- Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20101025/675b348f/attachment-0002.html>
More information about the M3devel
mailing list