Live data from Hacker News

Crystal 1.0 – What to expect

crystal-lang.org

71–80 of 351 posts

Re: Crystal 1.0 – What to expect

#71

Earlier quoted context omitted.

They haven’t backed off from global inference. They did move to require you to type collections, but methods are not inferred at definition but rather at invocation and it happens globally. There is no solution really. If you want a language to feel like it is dynamically typed but actually has types, something gotta give, and in this case it is compilation times. And it gets quite high fast.

> They haven’t backed off from global inference. You might know a lot more than me about the subject, so feel free to correct me, but I think it used to be truly global inference - as in you were expected to write the whole program with no annotations. But now you're required to annotate instance and class variable types, because compile times were becoming intractable.

It is still global. Typing collections and instance/class variables help, you can optionally type methods, but anything that is not explicitly typed is going to be inferred during invocation and that needs to happen based on all callers in the whole program. Reducing the amount of type variables do not eliminate the global behavior.

In contrast, local inference considers a predefined context, such as the current module or class, and is much faster, easier to cache, etc.

Re: Crystal 1.0 – What to expect

#72
post #70

Earlier quoted context omitted.

They "why" is basically having a language with the aesthetics and usability of Ruby, but fully statically typed with global type inference, and impressive performance. The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

The "downside" you forgot to mention a lot of important things: - tooling is abyssmal ( IDE etc ... ) - no mutli threading - no real support, I'm not even sure if there is one paid guy anymnore on the project - it's still immature - they break the API all the time

Besides funding (and maybe multithreading), I'd say that every new language will suffer from these limitations. They are difficult to avoid.

Re: Crystal 1.0 – What to expect

#73
post #70

Earlier quoted context omitted.

They "why" is basically having a language with the aesthetics and usability of Ruby, but fully statically typed with global type inference, and impressive performance. The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

The "downside" you forgot to mention a lot of important things: - tooling is abyssmal ( IDE etc ... ) - no mutli threading - no real support, I'm not even sure if there is one paid guy anymnore on the project - it's still immature - they break the API all the time

It is a relatively new language, all of the points you listed are expected. The last one should be taken care of now that they released 1.0.

Re: Crystal 1.0 – What to expect

#75
post #52

I think any new programming language should have a "why?" section on their page. I mean obviously this language is serving a need, but what is it? In any case, congrats! I like the features and would like to give it a try some day. I'm still curious about the motivations of this particular language though. Anyone more familiar care to elaborate a bit? Edit: Ok, looks like there is a "why" section on github!

They "why" is basically having a language with the aesthetics and usability of Ruby, but fully statically typed with global type inference, and impressive performance. The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

See, when you add "performance" to those properties it piques my interest. I'd love me a high performance language that is sanely typed, allows for metaprogramming, feels like an interpreted language while doing so etc. However the main page says absolutely nothing about performance. I even don't care about compile times.

So what is the performance like?

Re: Crystal 1.0 – What to expect

#76

Exciting news. Windows and multithreading are still showstoppers for me, unfortunately, but with the progress over the last couple years I'm hopeful that there's a light at the end of the tunnel on those fronts, especially now that the language itself is (ostensibly) stable.

multithreading is working with the -Dpreview_mt option, it's decent if the units of work are large enough at least 0,01ms, otherwise the channel overhead will dominate.

I find the API nice and easy specially for those familiar with CSP or go. Performance should improve once it gets the necessary love for it to be released to be on by default.

Windows requires a lot of boring work, especially considering most of the core devs use Linux / MacOS. Once they make it as priority it should be doable within a few months of work.

Re: Crystal 1.0 – What to expect

#77
post #15

How does it compare to Nim?

I've used both for medium sized projects.

Nim was a better fit for me because:

    - More mature tools and 'beaten paths'.
    - much faster compilation times
    - much better cross platform support
    - more people I can reach out to for help, amazing Discord server
    - simple concurrency for my needs
    - tiny binaries
    - low memory usage
    - simple to understand import system. (i hated ruby's import system)

Re: Crystal 1.0 – What to expect

#78
post #70

Earlier quoted context omitted.

They "why" is basically having a language with the aesthetics and usability of Ruby, but fully statically typed with global type inference, and impressive performance. The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

The "downside" you forgot to mention a lot of important things: - tooling is abyssmal ( IDE etc ... ) - no mutli threading - no real support, I'm not even sure if there is one paid guy anymnore on the project - it's still immature - they break the API all the time

> - tooling is abyssmal ( IDE etc ... )

As others have mentioned this is a side effect of how young it is.

> - no real support, I'm not even sure if there is one paid guy anymnore on the project

If paid support is all that counts then most languages would fall into that.

> - it's still immature

Tautological. Nothing can become mature without first being immature.

> - they break the API all the time

Isn't that what a 1.x is for? A stable major version?

Re: Crystal 1.0 – What to expect

#79
post #70

Earlier quoted context omitted.

They "why" is basically having a language with the aesthetics and usability of Ruby, but fully statically typed with global type inference, and impressive performance. The downside being a relatively slow compiler. It's the necessary trade-off for the type inference.

The "downside" you forgot to mention a lot of important things: - tooling is abyssmal ( IDE etc ... ) - no mutli threading - no real support, I'm not even sure if there is one paid guy anymnore on the project - it's still immature - they break the API all the time

Those downsides aren't intrinsic to the design of the language, and are likely to be present for any new, immature language.

The compile times are largely a side effect of the underlying language design, and it isn't likely to get significantly better, which is why I mentioned it.

Re: Crystal 1.0 – What to expect

#80
post #68

Earlier quoted context omitted.

I started this with my documentation because I am still convincing myself that it is a good idea. http://www.adama-lang.org/docs/why-the-origin-story

Which is exactly why you shouldn't do worry about why until later.

I'd argue it's vital to front-load the why question; before you can lead an effort you must believe yourself.

The importance of asking why is that you validate whether a project is some ego trip or a legitimate finding worth pursuing.

Post reply on HN