4 ms·
Guy Steele [1] sometimes mentions it. He gave an interesting Google Tech Talk called Four Solutions to a Trivial Problem [2], and at 1:59 [3] he said: Also, a
by EdwardCoffin 10y ago
Guy Steele [1] sometimes mentions it. He gave an interesting Google Tech Talk called Four Solutions to a Trivial Problem [2], and at 1:59 [3] he said:
Also, algebraic properties are important. I've got a background in applied algebra, and I think that has informed my programming. And I think that making programmers aware of algebraic properties of their code, and communicating some of those properties to the compiler, may be worthwhile.
The language Fortress [4], which he was one of the language designers of, allowed one to explicitly provide the compiler with such information - you could say that a certain operation was distributive or associative for instance, and the compiler could then do some refactorings and optimizations taking this knowledge into account.
[1] https://en.wikipedia.org/wiki/Guy_L._Steele_Jr https://en.wikipedia.org/wiki/Guy_L._Steele_Jr.
[2] https://youtu.be/ftcIcn8AmSY https://youtu.be/ftcIcn8AmSY
[3] https://youtu.be/ftcIcn8AmSY?t=1m59s https://youtu.be/ftcIcn8AmSY?t=1m59s
[4] https://en.wikipedia.org/wiki/Fortress_(programming_language) https://en.wikipedia.org/wiki/Fortress_(programming_language...
- FullyFunctional 10y agoGHC Haskell (not standard Haskell) supports this and it's heavily used. Look for "Rewrite rules".