breandan / kotlingrad

šŸ§© Shape-Safe Symbolic Differentiation with Algebraic Data Types
https://breandan.net/public/masters_thesis.pdf#page=49
Apache License 2.0
520 stars 21 forks source link

Gradual typing #17

Open breandan opened 3 years ago

breandan commented 3 years ago

Currently, Kotlināˆ‡ requires declaring all type and shape information at compile time. It should be possible to relax this constraint to support more flexible prototyping. To implement this feature, we would need to introduce an untyped class hierarchy to the DSL. Bidirectional operator overloads could be used to translate to and from the typed and untyped hierarchies. The semantics for these conversions must be thought out more carefully, but essentially would not be dissimilar to the existing operators for dimension switching, i.e. between scalar, vector and matrix functions.

References