News for hackers. Stuff that matters.
Re:Swift: Google’s Bet on Differentiable Programming by lmm on Thursday April 09, 2020 @07:41AM (#22821581)
It's not Prolog/SQL-style declarative programming; the part about setting the objective and calculating the gradient is an example use case, not the whole thing.

You'd like to be able to write your functions using the language's standard function syntax, but have access to both the function and its differentiated form. You can achieve it with macros (in an ad-hoc way) or as a custom language feature (what's being done here, again kinda ad-hoc), or you can use an algebra+interpreter style but at the cost of having to use a less natural syntax (Haskell do notation or similar). The thing that I'd say is closest to the ideal solution is something like stage polymorphism (which is genuinely an exciting new paradigm in my book: it squares the circle of macros versus strong typing), where you can write a function definition in natural function syntax and have access both to the function itself and the AST of the function in a much richer form than what a macro gets (which can be interpreted to produce a differentiated version of the function).

There are no comments on this comment yet.