{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/12462","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/12462/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/12462/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/12462/events","html_url":"https://github.com/JuliaLang/julia/issues/12462","id":99106941,"number":12462,"title":"static compile part 6: automated opt-in compilation","user":{"login":"stevengj","id":2913679,"avatar_url":"https://avatars.githubusercontent.com/u/2913679?v=3","gravatar_id":"","url":"https://api.github.com/users/stevengj","html_url":"https://github.com/stevengj","followers_url":"https://api.github.com/users/stevengj/followers","following_url":"https://api.github.com/users/stevengj/following{/other_user}","gists_url":"https://api.github.com/users/stevengj/gists{/gist_id}","starred_url":"https://api.github.com/users/stevengj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevengj/subscriptions","organizations_url":"https://api.github.com/users/stevengj/orgs","repos_url":"https://api.github.com/users/stevengj/repos","events_url":"https://api.github.com/users/stevengj/events{/privacy}","received_events_url":"https://api.github.com/users/stevengj/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/decision","name":"decision","color":"F08000"},{"url":"https://api.github.com/repos/JuliaLang/julia/labels/precompile","name":"precompile","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-08-05T03:10:29Z","updated_at":"2015-08-05T20:02:28Z","closed_at":null,"body":"Given automated recompilation (#12259, hopefully coming soon via #12458), it would be good to eliminate the manual call to `Base.compile` for most users, which is both awkward and dangerous (since users won't know whether a module is compilable).   I think we want a way for a module author to mark it as *compilable* so that `using Foo` will automatically call `Base.compile` if it has not been compiled yet.\r\n\r\nIt will be easy to implement this, once we decide on a syntax.  Some options:\r\n\r\n* a magic comment (e.g. ~~`#@compilable`~~ `#pragma compilable`) at the top of the file.  Pro: backwards compatible with Julia 0.3, easy to check *before* parse and `eval` of the file.  Con: not very Julian.\r\n* `@compilable module Foo ... end`: Pro: more Julian, can be checked after parsing but before `eval`. Con: not backwards-compatible (a major problem), requires parsing.\r\n* `@compilable` statement *inside* the module. Pro: can be made backward-compatible via Compat. Con: must eval the module to execute it, which means that if it is compiled too then it gets evalled twice, and the compiled version is not the one that is loaded (since it has already been imported).\r\n\r\n*Updates:*\r\n* via `Pkg`: e.g. a `COMPILABLE` file in the package directory would cause the package to be compiled when it is added (automated recompilation could handle the rest). Pro: backward compatible, no parse/eval.  Con: auto-compilation only available for registered packages.\r\n\r\nAny other options?  I have to admit that I lean toward the magic comment, since avoiding parse/eval is attractive enough to me to compensate for the slight syntactical ugliness."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/128131746","html_url":"https://github.com/JuliaLang/julia/issues/12462#issuecomment-128131746","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/12462","id":128131746,"user":{"login":"tkelman","id":5934628,"avatar_url":"https://avatars.githubusercontent.com/u/5934628?v=3","gravatar_id":"","url":"https://api.github.com/users/tkelman","html_url":"https://github.com/tkelman","followers_url":"https://api.github.com/users/tkelman/followers","following_url":"https://api.github.com/users/tkelman/following{/other_user}","gists_url":"https://api.github.com/users/tkelman/gists{/gist_id}","starred_url":"https://api.github.com/users/tkelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkelman/subscriptions","organizations_url":"https://api.github.com/users/tkelman/orgs","repos_url":"https://api.github.com/users/tkelman/repos","events_url":"https://api.github.com/users/tkelman/events{/privacy}","received_events_url":"https://api.github.com/users/tkelman/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T20:02:28Z","updated_at":"2015-08-05T20:02:28Z","body":"Eww, -1 to significant comments. Comments are for humans, and get thrown away pretty early in the Julia parsing-to-execution pipeline."}}