News for hackers. Stuff that matters.
Re:Crystal 1.0 – What to expect by Zababa on Monday March 22, 2021 @07:05PM (#26548641)
> The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

I'm curious about that, MLs usually have fast compilers (OCaml for example) and have type inference. I thought that the slow compilation times were due to LLVM .

Re:Crystal 1.0 – What to expect by Trasmatta on Monday March 22, 2021 @07:44PM (#26549045)
Crystal's type inference is more powerful than most other languages. Maybe the most powerful of any fully statically typed language? (I would love to hear of any others that have taken the same approach as Crystal.) You can almost write Crystal like a dynamically typed language, and yet everything is still fully statically typed.

I believe you can speed up your compile times a bit by being explicit with annotations (which I often prefer anyway), but there's still a lot of overhead for the global type inference.

Re:Crystal 1.0 – What to expect by fishmaster on Monday March 22, 2021 @07:56PM (#26549161)
> Maybe the most powerful of any fully statically typed language?

Compared to Haskell, Ocaml, Scala, F#, ...? Writing it like a dynamically typed language is standard for full type inference.

Re:Crystal 1.0 – What to expect by asterite on Monday March 22, 2021 @08:01PM (#26549200)
Those functional languages don't have function overloading or named arguments. The type inference in Crystal works very differently. The type of a method can only be computed from explicit calls to it. In those functional languages the type can be computed independent of a call because it's trivial to do so if a function name always refers to a single entity.
Re:Crystal 1.0 – What to expect by Zababa on Monday March 22, 2021 @08:06PM (#26549237)
> Those functional languages don't have function overloading or named arguments.

Scala has both, F# too (though function overloading is possible, I think it's not idiomatic), OCaml has named arguments, Haskell has overloading.

Re:Crystal 1.0 – What to expect by Trasmatta on Monday March 22, 2021 @08:08PM (#26549248)
I should have qualified that statement with OO languages, not functional. Also see asterite's reply, he would know much better than me, as I believe he's one of the core Crystal developers.