Live data from Hacker News

The Crystal Programming Language

crystal-lang.org

61–70 of 116 posts

Re: The Crystal Programming Language

#61
I'm a Ruby guy and I tried Crystal for about 2 years and absolutely loved it but then had to give up for the following reasons:

1. Too slow to compile (the whole program + the entire stdlib is built everytime you build!). No incremental compilation available.

2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do!

3. Obscure error messages (macros are to blame here)

4. Weak HTTP server implementation -- making things such as a fetching POST params or uploads incredibly frustrating. Once read the request body cannot be read again.

5. Weak/non-existent Windows support

6. No multicore support

7. Obviously small community

8. Nil handling takes a bit getting used to (coming from Ruby)

9. Error messages are hard to read with overloaded methods wherein just the types are used without any indication of what doesn't match

Overall, if the above changes, I'd switch to it in a heartbeat!

Re: The Crystal Programming Language

#62

Earlier quoted context omitted.

Probably because of the Ruby inspired syntax which just brings joy. Hopefully the ecosystem can grow and partially catch up as well

i've seen that said so many times, and fail to understand why Ruby syntax brings joy. Personally, I thought the muddled Proc, block, and lambda situation a mess, coming from Scheme 30 years ago to Ruby 20 years ago.

Well it would seem very messy coming from Scheme!

Scheme is a small language which achieves expressiveness by allowing you great freedom to push the language into bold new forms.

Ruby (especially with Rails which should almost be considered a separate language) is a big language where simplicity is maintained by informal convention.

Ruby has lots of muddles and messy features, good Ruby code bypasses them.

Re: The Crystal Programming Language

#64
post #61

I'm a Ruby guy and I tried Crystal for about 2 years and absolutely loved it but then had to give up for the following reasons: 1. Too slow to compile (the whole program + the entire stdlib is built everytime you build!). No incremental compilation available. 2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do! 3…

> 2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do!

Emacs' dumb-jump appears to have some basic support for go to definition: https://github.com/jacktasia/dumb-jump/blob/master/dumb-jump...

But out of curiosity, what is the issue from a technical point of view?

Re: The Crystal Programming Language

#65

Earlier quoted context omitted.

Nim and Crystal feel like they are in exactly the same space? GC, fast, single executable compilation without runtime (I would also throw Go into this list).

You can ditch Nims GC and runtime and bring your own if you want. Of course you'd lose access to most of the stdlib but this is why Nim can be used and is popular for embedded / bare metal. Tmk Crystal still lacks Windows support as well and probably other os's / archs's compared to Nim

Windows support is close. See this issue:

https://github.com/crystal-lang/crystal/issues/5430

Re: The Crystal Programming Language

#66
post #64
post #61

I'm a Ruby guy and I tried Crystal for about 2 years and absolutely loved it but then had to give up for the following reasons: 1. Too slow to compile (the whole program + the entire stdlib is built everytime you build!). No incremental compilation available. 2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do! 3…

> 2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do! Emacs' dumb-jump appears to have some basic support for go to definition: https://github.com/jacktasia/dumb-jump/blob/master/dumb-jump... But out of curiosity, what is the issue from a technical point of view?

The technical challenge is that a Crystal program needs to be inspected as a whole. Simplified, changes in location A can have effects on some completely unrelated location B. That makes it hard to cache intermediary results and a semantic analysis needs to cover the entire program (including the standard library), not just the files that were changed since the last time.

This applies to the responsiveness and memory consumption of the language server as well as the regular compilation process. So this is an important topic, and we're working on improvements. It's a complex topic, but there are some ideas.

Re: The Crystal Programming Language

#67

Earlier quoted context omitted.

i've seen that said so many times, and fail to understand why Ruby syntax brings joy. Personally, I thought the muddled Proc, block, and lambda situation a mess, coming from Scheme 30 years ago to Ruby 20 years ago.

> Personally, I thought the muddled Proc, block, and lambda situation a mess Why not use one (probably just block) for everything? Coming from ruby 10 years ago.

Blocks can't be stored in variables.

Re: The Crystal Programming Language

#68

Out of all the programming languages coming out these days, Crystal is the one I am watching out for. I've never programmed with Ruby, but I have programmed with Python in the past so I really value the focus on programmer friendly syntax that Python taught me. Currently a Golang a programmer and I love the performance plus binary executables! From my experience so far Crystal feels like a performant language with th…

Just curious whether you have checked out Nim. I love it coming from Python, curious to know what Crystal offers apart from Nim for Python users.

Compared to Nim, Crystal is more OOP-focused and very similar to Ruby, so if that's your thing, it's worth switching, otherwise probably not.

Re: The Crystal Programming Language

#69
post #36

Earlier quoted context omitted.

Windows is still not exactly supported. The language is nice though. It seems like it would benefit from a bit more publicity.

It's almost fully supported on Windows currently. There's one open PR and one open issue [0] remaining before windows is considered supported. [0] https://github.com/crystal-lang/crystal/issues/5430

Great news!

Re: The Crystal Programming Language

#70
post #2

What is the edge it gives when compared to Rust, Zig, and Nim?

Probably the biggest differentiator compared to those three is that it's object-oriented. Rust, Zig and Nim are all procedural.

Rust definitly supports COM style OOP, and Nim does have OOP support.
Post reply on HN