4 ms·
I like Ruby, it works well for scripting, and this compiled variant of the language is very interesting. I liked its variant type (e.g. (Char|String|Int)) for i
by a-nikolaev 11y ago
I like Ruby, it works well for scripting, and this compiled variant of the language is very interesting. I liked its variant type (e.g. (Char|String|Int)) for instance, and in many other respects it looks great.
What puts me off somewhat is that it seems that Crystal uses the same stupid scoping rules as Ruby. I would not call them insane, but they are kinda funny (compared to normal lexical scoping like in ML or Scheme), and the new language could fix that. [The documentation does not have a section on scoping, so I'm not 100% sure about this issue]. Another strange element of the Ruby syntax that does not make a lot of sense to me is proc.call("blah"). Was that "call" bit really necessary in the new language? Probably, not really.
In any case, my complaints are quite minor, and probably the author considered all pros and contras when making these particular choices. Overall the work looks very interesting. I usually prefer OCaml for my programming, however it's not always a perfect tool and I was trying to find some other language that will work better. So far, nothing could work better, but Crystal is a step in the right direction, I think.
- pkulak 11y agoThat call() stuff happens when you allow method invocation without parens. Otherwise, there would be no way to assign the proc without invoking it. I agree with you about the scope stuff though. I think I even remember Matz lamenting it at one point and saying it may change in a later version. That was back at 1.8 though, so I guess at this point it's not going anywhere.