Library defined optimizations

121 views
Skip to first unread message

Suminda Dharmasena

unread,
May 12, 2016, 12:52:10 AM5/12/16
to dotty-internals
Can you introduce term rewriting system to do user defined optimisations and reduction. Actually once introduced the compiler specific optimisation can be use the same framework also. Languages like Nim has this http://nim-lang.org/docs/tut2.html#templates and used for much advantage in projects like: https://github.com/unicredit/linear-algebra

Dmitry Petrashko

unread,
May 13, 2016, 8:32:29 AM5/13/16
to dotty-internals
We have already plans here.
For simple declarative rule that can be context dependent and work across libraries see example here: https://github.com/dotty-linker/dotty
For complicated rules with full meta-programing we will have scala.meta: http://scalameta.org/

Suminda Dharmasena

unread,
May 13, 2016, 9:02:07 AM5/13/16
to dotty-internals
Looks great.

Suminda Dharmasena

unread,
May 13, 2016, 12:40:35 PM5/13/16
to dotty-internals
Can you add ability to have conditional / context based rewrites. Say rewrite only if x is annotated. Also say y is annotated and of type Y I want to change the type of y to generate type Y' and replace the type of y with Y'.
Reply all
Reply to author
Forward
0 new messages