feersum icon indicating copy to clipboard operation
feersum copied to clipboard

Types and Optimisation

Open iwillspeak opened this issue 3 years ago • 0 comments

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.

  • Constant foldig
  • Direct calling to target methods avoiding the Func<object[], object> if argument types are known
  • Liveness tracking and escape analysis?

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.

iwillspeak avatar Nov 13 '21 07:11 iwillspeak