<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On May 23, 2014, at 7:50 AM, Manuel Klimek <<a href="mailto:klimek@google.com">klimek@google.com</a>> wrote:<br><div><blockquote type="cite"><br class="Apple-interchange-newline"><div><span style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">It just seems to me like adding a second way to lazily pull in parts of the AST would be a waste of engineering time (and very hard to do without the change in language restrictions that modules impose).</span></div></blockquote></div><br><div>I think Richard answered this question pretty well, but I think these are fundamentally different problems. We're talking about lazily synthesizing function bodies on demand, in the context of the existing translation unit. For flexibility, we want the definitions of these function bodies to adapt to the specifics of the translation unit, e.g. the definitions of the types used to define the parameter and return value. That means the source bodies are not self-contained modules.</div><div><br></div><div>There also seems to be complexity here when using a system that already used modules. Consider a case, like OS X, where the APIs are accessible from modules. Say there is an API, foo(), whose API is vended by a module, and that's how it gets imported into a translation unit. At analysis time, however, we want a body for that function, even if one was not provided. We then want to conjure up a function body for foo(), even though its declaration of foo() was already pulled from a real module and for all intensive purposes is considered part of *that* module, not our fake one that contains our faux definition for foo().</div><div><br></div><div>FWIW, this lazy conjuring of function bodies is what we do today in BodyFarm. We just do it in an ad hoc way by creating the ASTs by hand.</div></body></html>