JuliaStaging / GeneralizedGenerated.jl

A generalized version of Julia generated functions @generated to allow closures in generated functions and avoid the use of runtime eval or invokelatest.
MIT License
89 stars 10 forks source link

precompilation support like RuntimeGeneratedFunctions.jl #65

Open thautwarm opened 3 years ago

thautwarm commented 3 years ago

So far caching GG's type encoding is unsafe when it comes to precompilation, as a result, several packages using GG need to consider some internal stuffs like implementing __init__.

GG v0.3 uses much less memory but makes this issue more severe.

The idea to address this is introducing per-package cache store(like RuntimeGeneratedFunctions.init) to work arbitrary precompilation. The way to integrate GG v0.3's memory efficient caching is making downstream packages hold their own cache pools and indices(shall not change after building the module), while those caches will be copied/merged into the big pool held by GG after downstream's module loading.