FunctionWrappers in stdlib?

I think we should have this, see this issue for a description of what those are and my argument for why it should be in stdlib.

These are currently used in ReverseDiff.jl. See my simulator of a MOS 6502 CPU for another fun application. You will find that you need them every time you need to efficiently unbox a function (e.g. if you hold functions in a container), which seems like a fairly generic use case to me.

Opening this thread is nothing other than redundant, shameless promotion. Hopefully you’ll all forgive me for abusing discourse slightly :blush:.

5 Likes

Very much in favour of guaranteed long-term support if FuncrionWrappers

I am under the impression that the core devs are currently focused on changes that need to be breaking before getting v0.7 out, so anything can be done later is deprioritized. So I am not sure that bumping these issues is productive. Things don’t get lost, I expect they will be done later.

I know, my thinking was more 1.1 timeline.

I feel kind of awkward asking “please write and maintain this for me” on an open source project anyway, but this is the one thing that I can think of that you just “cannot do” right now in Julia. The stuff in Base and stdlib currently is great, but quite a bit of it I suspect most people would be able to create equivalent functionality for themselves if they needed, whereas this is something that probably only a handful of people have the expertise to write without extensive research, so it feels like kind of an awkward hole.

1 Like

Speaking for myself, I don’t want to make FunctionWrappers official at this point because we may want something even more integrated into the language than just a stdlib package. We may want syntax for it and perhaps some kind of enhanced higher order programming support for wrapped functions. (E.g. How is a single method in isolation different than a monotyped function?) If we make FunctionWrappers official now, that’s more potential deprecation work in the future. So I’d rather wait and think about this issue more when we have time and bandwidth to do so. Of course, we may look at it and just decide that it’s perfect as is and put it in the stdlib and be done. But I’m not certain of that and just deciding what to do is work.

11 Likes

Sounds good to me! :smile: