Re:Chicken Scheme
by arc-in-space on Friday September 03, 2021 @05:09AM
(#28401968)
It helps. Chicken seems to support exactly that: 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.
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.