DIP69 - Implement scope for escape proof references
Daniel Murphy via Digitalmars-d
digitalmars-d at puremagic.com
Thu Dec 4 18:39:06 PST 2014
"H. S. Teoh via Digitalmars-d" wrote in message
news:mailman.2709.1417745546.9932.digitalmars-d at puremagic.com...
> I've often pondered about the possibility of a language where the
> compiler will analyze each module and infer any number of attributes and
> optimization opportunities for each symbol exported by that module, and
> this information will be saved in the object file (or some other kind of
> interfacing file). This includes any half-compiled template bodies and
> whatever else that can't be fully codegen'd until actual use. The
> attributes will include all sorts of stuff that programmers normally
> wouldn't want to deal with -- there could be 10+ or 50+ attributes
> representing various optimization / static checking opportunities. Then
> every time a module is imported by another module, the compiler never
> goes to the source code of the imported module anymore, but it will read
> the object (interface) file, which is fully attributed, and the saved
> attributes will be used internally for static checking, optimization,
> and inferring attributes for the current module.
This can't be used to infer attributes that can produce errors - those
attributes have to be user-visible or the errors don't make any sense. If
it's purely for optimization, then that's basically what LTO does.
More information about the Digitalmars-d
mailing list