I’m using FunctionWrappers.jl to create type stable wrappers for functions I know input and output types. These functions are often closures created in local scopes. When trying to trim a function from FunctionWrappers.jl (or, better, a vector of those), compilation fails. Looking at this julia issue RFC: TypedCallable · Issue #59774 · JuliaLang/julia · GitHub indeed it seems to confirm FunctionWrappers.jl is not compatible with trimming. The issue also proposes a very nice enhancement which would solve my problem, but still it isn’t implemented in Julia until today. So, I’m asking myself if also some other people encountered this issue before and/or know about techniques which can be used to trim a vector of functions with known inputs and outputs, even with no so great performance.
2 Likes
Really wonder why that is. My initial guess was that the trimmer doesn’t recognize the pointers to compiled code as reachable somehow (I have zero idea how finding reachable code works in the first place), but the FunctionWrapper’s pointers don’t line up with the method’s CodeInstance’s when I looked into it, and I failed to find good up-to-date documentation on what any of the fields mean.
1 Like
I’m not sure either why FunctionWrappers can’t be trimmed, perhaps improving that implementation would make it possible to use this feature before the TypedCallable type lands into main Julia, but I don’t have any idea on what needs to be changed.