DEV Community

Discussion on: We created the Crystal language, ask us anything!

Collapse
 
mverzilli profile image
Martin Verzilli

It is very important, and one of the reasons we slowed down development. Our main concern is to get to a point where we know whether we'll have to make any breaking changes to the language to keep compilation times at a satisfactory level. That question is quite hard to answer without a formal specification of the language, but then again formal specification of the language is by itself a huge endeavor.

The good news is we haven't explored the solution space, we're confident that we can make it.

About incremental compilation, I'm not sure to what extent that will be possible without some "big change" to the language. Right now the "type inference magic" of Crystal depends on knowing all the source code ahead of time, and that makes it difficult to identify proper compilation units.

Collapse
 
opensas profile image
opensas

I wonder if requiring all public api (input params and return types of every public method) of a file to be typed would allow incremental compilation. In that case, you could add a switch to the compiler to warn you of any typing required to allow incremental compilation. That way, if you want to speed up compilation, you could add the required type. Is it feasible?

Collapse
 
paulcsmith profile image
Paul Smith • Edited

Thanks for the reply. I'm glad to hear it's a priority and that you're being careful about the language :+thumbsup:

Collapse
 
tbodt profile image
tbodt

You could look at what Rust is doing with incremental compilation. They do type inference in a similar way (though less insane) and they've been working on getting incremental compilation for a few years now.

Thread Thread
 
mverzilli profile image
Martin Verzilli

We do a look a lot at Rust, not only regarding incremental compilation. We really like how they organized the community, for example. And given they also use LLVM, we sometimes can leverage some of their findings, tooling or advances, so if there's any member of the Rust team seeing this: thank you for being a source of inspiration :).