News for hackers. Stuff that matters.
Re:Crystal: Fast as C, Slick as Ruby with Tom Richards by fuzztester on Saturday March 09, 2024 @02:45PM (#39654205)
>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?

Re:Crystal: Fast as C, Slick as Ruby with Tom Richards by fredrikholm on Saturday March 09, 2024 @03:39PM (#39654553)
Crystals, 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.

Re:Crystal: Fast as C, Slick as Ruby with Tom Richards by bdjsiqoocwk on Saturday March 09, 2024 @04:55PM (#39655044)
Julia allows you to specify no types, and it still supports incremental compilation.
Re:Crystal: Fast as C, Slick as Ruby with Tom Richards by fuzztester on Saturday March 09, 2024 @05:01PM (#39655078)
Wow.

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

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.