3 ms·
Would having (optional) type annotation, or even a relatively coercitive type system help much in the way of performance? Admittedly, this wouldn't be scheme an
by rosetremiere 5y ago
Would having (optional) type annotation, or even a relatively coercitive type system help much in the way of performance?
Admittedly, this wouldn't be scheme anymore, but are there example of this done in the wild with profitable impact? E.g. even as an extension to RXRS.
I'd guess if you're sure your `fib` function handles only integers, you should get a lot of easy inlining/specialization at your disposition.
- arc-in-space 5y agoIt helps. Chicken seems to support exactly that: https://wiki.call-cc.org/man/5/Types https://wiki.call-cc.org/man/5/Types Chez instead provides typed/unchecked arithmetic functions, like fx+, flround and so on. In my experience, those sometimes make a big impact on performance(though realistically in some of those cases it would be better to ask C to do it for you). Racket similarly makes it possible to do either.
- johncowan 5y agoChicken supports fx+ and flround as well, as do all R6RS and R7RS-large systems.