You can track progress at https://github.com/crystal-lang/crystal/issues/5430
But for many applications that's a non-issue.
Re:Switch from Ruby to Crystal
by rishav_sharan on Friday November 06, 2020 @07:03AM
(#25007010)
The funny thing about the lack of "windows support" is that crystal is already good enough for windows programs which don't need networking (which is the only missing piece). Crystal can already work on Windows for use cases like gamedev (see crSFML), console apps, AI/ML etc.
Yet the Crystal team hasn't made a preview windows build which can enable all those use cases and the act of using Crystal on Windows is super convoluted as a result.
Compilation times can hurt too, I'm not sure if that's improved or being worked on though.
Re:Switch from Ruby to Crystal
by progressbwc on Friday November 06, 2020 @04:39AM
(#25006375)
Crystal does global type inference to be performant while “feeling like a dynamic language” - as claimed by the article. This leads to very high compilation times (which is non-linear so a program double the size will likely take more than double the time to compile) and last time I asked I was told it is not a solvable problem.
Re:Switch from Ruby to Crystal
by chrisseaton on Friday November 06, 2020 @05:14AM
(#25006518)
> Crystal does global type inference
I think they stepped back from this a few years ago. It's not globally inferred anymore - you need to specify some types manually.
Yes. The basic rule is that things that could be stored on the heap will need to be explicit or inferrable directly from the constructors. But as method parameters generally (except sometimes, like in procs) don't need typing it is quite possible to build full programs using only global inferrence. But that is usually not how programs are built - that would do away with things like objects and structs and other constructs that are extremely ideomatic.
Does that overhead go down if you tag lots of places with types manually?
Re:Switch from Ruby to Crystal
by progressbwc on Friday November 06, 2020 @05:01AM
(#25006474)
Yes but it is unlikely to make a difference unless a major part of ecosystem changes which is unlikely to happen as it will lose its “dynamic feeling”. Even the standard library has to be compiled when you compile your project.
There is some caching to help but times are still high. IIRC the compiler is not parallel either, so having more cores won't help.
There is also a —release compile flag that you would want to use for production and it is much slower.
No windows support. (Seems to be progressing, though)
https://github.com/crystal-lang/crystal/issues/5430