Function body macros

When proposals for differentiable programming first circulated in these forums, I raised concerns (here and here) that the proposal was too domain-specific to be a language feature. I wished instead for “a system for AST transformation that could make ‘differentiable’ a library” feature instead.

I wonder: is this proposal robust enough to accomplish that? It seems on the surface that it might be: HasTrailingOptionalCodeBlock appears to give full access to the structure of the function body….

This is not a question about differentiable programming so much as a question about the scope of function body macros. I’m trying to get my head around just how robust this proposal is. Might be a use case for vetting it (and for mentioning in the proposal body).

4 Likes