Had a stupid idea, and wanted to see if it holds any water.
One thing that I have heard very often about the slower compilation speed of Crystal is that it is due to the global type inferencing.
I was wondering if we can do the following;
- add a call in a custom variant of the compiler where it lists out every instance of type inferencing alongwith the name and position of that initiatlization
- simply start adding types to the compiler and all stdlibs till we have worked down this list
Is is correct to assume that if most of initialized have the correct types upfront, we will actually have faster compilation speed?
We can even have a something like a “–use_strict_types” as a compiler flag so that all library authors can also try to reduce their type inference usage.