What do you think about the following math-related...
# mathematics
z
What do you think about the following math-related kotlin lib: https://plus.qconferences.com/plus2021/presentation/differentiable-programming-kotlin?
K 4
a
Yes, we've discussed what Facebook does. I did not like the preview API in their first post since it abuses the language modification, but we will see how it works. Automatic differentiation is already implemented via MST connector to KotlinGrad, Commons-math DifferetiableStructure and Roman Elizarov's first order differentiation via function propogation.
z
What kind of abuse? (I failed to find the API)
a
They fork the compiler to introduce a new keyword and variadic generics. They also use a rather restricting API that limits AD to doubles. Of course it could change. In KMath we were able to do almost the same on the library level. Boolean logic is still missing though.
z
I think they could (and should) do the same with compiler plugins.
a
Thing they done in the preview is impossible with compiler plugin. At least variadic generics are.
z
Do you mean some
class<T, ... S>
?
How did they compile it to JVM?
a
Fork the compiler. This is a problem with CS people. They write compilers wherever they can.
z
I'll try to do something like that in summer with a plugin. I haven't created any but I'm interested in it.
a
You can start with the staged compilation in the jupyter. It allows to emulate most of compiler plugin features without digging deep into the compiler
z
Where can I about it? (Or where to find it at least)
a
There will be a workshop next week on building a plugin: https://www.meetup.com/KotlinMoscow/events/278196467, buti won't talk about staged compilation. Also there will be a talk in Russian by @Ilya Muradyan: https://www.meetup.com/KotlinMoscow/events/278027639/
z
Ok, I'll try to watch both. Thank you for the announcement!
Will there be recordings for the meetups?
a
Yes
👍 1