iwillspeak / feersum

A Scheme compiler that targets .NET written in F#
http://playlist.feersum-scheme.net
MIT License
24 stars 1 forks source link

Types and Optimisation #49

Open iwillspeak opened 2 years ago

iwillspeak commented 2 years ago

At some point it would be nice to support optimisations. I think that some form of gradual typing / type inference would help here. For many scheme expressions the latent / dynamic type can be inferred at compile time. This would then allow for further optimsations and improvements.

Some of this could be driven by the idea of 'type predicates' (integer?, vector?, etc. ) in a manner similar to TypeScript. There is also discussion of 'assumptions': https://srfi.schemers.org/srfi-145/srfi-145.html that might be useful to enable more powerful optimisations in a given block.