[racket] Optimizations at the library level.

From: Noel Welsh (noelwelsh at gmail.com)
Date: Thu Sep 2 04:49:08 EDT 2010

On Wed, Sep 1, 2010 at 10:01 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:

> ...  Though, it might be a useful thing for the Racket
> interpreter (compiler) to have hooks of some kind for pluggable
> optimizations.  Useful both for practical use and for increasing how Racket
> can be used as a language research platform.

GHC allows user specified rewrite rules:


I don't know how effective they are in practice. They raise tricky
semantic issues and more so in an eager language with side-effects.
See http://www.haskell.org/haskellwiki/Playing_by_the_rules

> It's fortunate that Matthew has seemingly infinite time for all the work
> that people would like him to do. :)


> I still like the idea of doing the matrix optimizations in pure Racket with
> internally-optimizing ADTs with lazy operations, rather than with syntax
> extension mini-language, an entire front-end language, or compiler hooks.

The ADT approach is the most practical, I believe. There is a Python
project called Theano (http://deeplearning.net/software/theano/) that
does similar. It can spit out C and GPU code and do other fun stuff.


Posted on the users mailing list.