Re:Crystal Programming Language
by axelthegerman on Thursday September 01, 2022 @10:41PM
(#32685987)
Probably because of the Ruby inspired syntax which just brings joy. Hopefully the ecosystem can grow and partially catch up as well
[ Parent
| on HN ]
Re:Crystal Programming Language
by jjtheblunt on Friday September 02, 2022 @12:16AM
(#32686520)
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:Crystal Programming Language
by threatofrain on Friday September 02, 2022 @12:40AM
(#32686664)
Ruby was among the first languages I learned, back when there was the possibility of Ruby being a general purpose language and not just Rails. My joy was the result of being able to guess syntax and be right. Nowadays I value reading documentation and IDE level support, so guessing syntax is no longer a joy.
Re:Crystal Programming Language
by zelphirkalt on Friday September 02, 2022 @07:52AM
(#32689508)
When I saw it, I felt the same way (also using Scheme a lot) and I still feel it is messy. However, what I think might be the reason for it, is that it is difficult to store a lambda in Scheme including its whole environment in an object and send that over the wire somewhere else, on a different machine to run. Perhaps distinguishing between Proc, block and lambda gives Ruby a possibility to treat one of them specially, so that it can do these things easily?
Re:Crystal Programming Language
by straight-shoota on Friday September 02, 2022 @06:44AM
(#32689090)
I can gladly point out that Crystal has a much cleaned up syntax for blocks and procs (compared to Ruby): https://crystal-lang.org/reference/1.5/syntax_and_semantics/...
> 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.
Yes, I don't store them in variables, but I can expand them in generators and yield them. To me, that is much more useful than storing them.
I guess those things are a compromise. Being able to use that concept easily is a joy. The implementation prioritises developer convenience over syntactic purity. It’s a shame we can’t have both, but I accept the trade-off.
That's quite a minor nitpick on an entire language that's been around for over 25 years.
Re:Crystal Programming Language
by ed25519FUUU on Friday September 02, 2022 @12:41AM
(#32686667)
I guess beauty is in the eye of the beholder because I look at that syntax and cringe.
What about it makes you cringe?
Re:Crystal Programming Language
by ed25519FUUU on Friday September 02, 2022 @11:39AM
(#32692058)
This kind of thing
End
End
End
End
EndWhile it is not completely impossible to end up (pun intended) with something like this, you usually follow a coding style that avoids it. Kind of like in Ruby.
You have the option to define named methods that yield or to use the short one-parameter syntax where this:
method do |param|
param.some_method
end
becomes method &.some_methodI get no joy from Ruby syntax. Haskell syntax on the other hand I love...
Re:Crystal Programming Language
by piyushpr134 on Friday September 02, 2022 @08:51AM
(#32690040)
Same argument that I keep on having with people who like
1. gray and darker gray buildings of a tree-less megacity beautiful, with a dash of color
vs
2. those who find small cities/villages mixed with art, trees & colourfully dressed people beautiful.