3 ms·
>Because of how the type inference works, the compiler cannot (effectively) compile incrementally, which means that any change causes a full compilation. This i
by fuzztester 3y ago
>Because of how the type inference works, the compiler cannot (effectively) compile incrementally, which means that any change causes a full compilation. This includes dependencies.
Is this an issue of type inference in general (and therefore exists in all languages that do type inference), or is it related of Crystal's implementation of type inference?
- fredrikholm 3y agoCrystals, as it allows you to specify zero types in your entire project should you want to, whilst still type checking in a language where every type is implicitly a union (eg. "this is a string or an int or null"). The result of that is a cyclical graph where nodes are traversed several times over per pass, for several passes, with increasingly more information until it reaches a state where all callers have been accounted for.
- bdjsiqoocwk 3y agoJulia allows you to specify no types, and it still supports incremental compilation.
- fuzztester 3y agoWow. Thanks for both of your replies. The last paragraph of your reply above reminds me somewhat of a part of this talk, somewhere near the end: Lang NEXT 2014 Panel Systems Programming in 2014 and Beyond https://youtu.be/ZQR32nTVF_4?si=zQNTWBXcp4TkSnRh https://youtu.be/ZQR32nTVF_4?si=zQNTWBXcp4TkSnRh It is the part where Bjarne Stroustrup talks about the issue of the huge compilation times of multi-file C++ projects, due to the number of times that header files are repeatedly included, IIRC. The section is a bit funny, with the responses from the other participants. There may be a solution for by now (modules), but I am not a C++ guy, so don't know if it exists or is good enough. Interested to know what others think of this.