Live data from Hacker News

Crystal 1.0 – What to expect

crystal-lang.org

121–130 of 351 posts

Re: Crystal 1.0 – What to expect

#121
post #75

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.

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?

It's at least on par with Go, for solving similar problems, micro benchmarks, etc.

Re: Crystal 1.0 – What to expect

#123
post #53

If curious, here are the significant past threads I found. Others? An Introduction to Crystal - https://news.ycombinator.com/item?id=26217013 - Feb 2021 (39 comments) Switch from Ruby to Crystal - https://news.ycombinator.com/item?id=25005780 - Nov 2020 (35 comments) Go vs. Crystal Performance - https://news.ycombinator.com/item?id=23615303 - June 2020 (160 comments) Ruby vs. Crystal Performance - https://news.ycombi…

I guess it's an obligate-GC language.

It would help if the front page were to say.

Re: Crystal 1.0 – What to expect

#124

Earlier quoted context omitted.

Do zig, python, elisp, Clojure, Haskell (mostly a research project), etc fit the bill?

Out of those Pythons the only one that's widely used in production, and it's been around for a long time. Python itself is an extremely simple language, which I think can work as one person passion project. Modern python has grown significantly from its first release in the 90s though. I don't think that can happen today, we all want too much out of our programming languages.

Python also has active sponsorship. Guido and the mypy folks were employed at Dropbox for the express purpose of working on Python last I checked, and even then my biggest grievance with Python is that the big hairy problems (performance, package management) still never get solved.

Re: Crystal 1.0 – What to expect

#125
post #5

Really happy to see this go 1.0. Between Crystal and Zig it's nice to see C++/Rust get some competition

Would a developer looking a Zig/C++/Rust really also consider Crystal? I figured Crystal was for Ruby developers who want a good static type system.

I'd consider it more seriously now it's 1.0. You've basically got an ecosystem of Ruby-likes:

- Ruby itself

- Crystal

- Elixir

I'm massively keen on Zig, too, but it still feels like early days for the language itself. The C-interop is utterly astounding but I don't want to write Zig as syntax-sugar around C libraries.

Re: Crystal 1.0 – What to expect

#127
You know, I have been language-hopping for over a year now, in hope to find a secondary language I could learn beside the bread-winner Java. Trying to strike the balance between productivity and performance is pretty hard.

I tried Go, it looks ugly (sorry).

I tried Rust: it is beautiful in concept but I don't feel productive enough. I mean, maybe my use case is not align with Rust.

My secondary lang should allow me to do more exploration in data analysis and not system programming.

I looked and Nim/Zig and something else in between like Lua and Python (for the 4 times in 4 years I think). Nim is nice but the ecosystem is not there. Zig is also sys-programming focus. Python ecosystem is huge but I just don't feel like the perf is a killer. What I really love about Python is the list comprehension, i.e a_list = [(Ababa) for a in 1..100 for b in 'a'..'z'] for example.

Until I found Julia, everything else is history. It seems to have everything I have asked for and more. Albeit that the precompile time is abysmal but I know I could use the sysiamge hack-around.

I think I'd stick and be content with Julia! With VS Code's Julia extension plus the remote (SSH) development, I could do many "cool" things people do in Python except maybe more performant :-)

Re: Crystal 1.0 – What to expect

#128
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!

Not sure that Crystal is considered a “new” programming language.

Re: Crystal 1.0 – What to expect

#129

Earlier quoted context omitted.

Crystal's appeal, for me at least, is the productivity of Ruby with the memory efficiency and execution speed of C++. Static typing is just a way of achieving that, it's not something I'm seeking per se.

Remember static typing is also really useful for code quality and avoiding hidden bugs. Some code in Ruby requires a ton of specs to discover bugs caused by type issues, while the Crystal compiler tells you immediately that something doesn't work out. I love Crystal's type system really for productivity reasons.

If all you get from static typing is runtime performance and correctness, your type system is not pulling its weight.

In any serious statically-typed language, the type system does real heavy lifting. In practice that means that libraries execute code at compile time that, in effect, generate the code you would otherwise need to write (again) yourself.

C, Pascal, and Go are examples of statically typed languages whose type system does only trivial work.

Re: Crystal 1.0 – What to expect

#130

Earlier quoted context omitted.

Would a developer looking a Zig/C++/Rust really also consider Crystal? I figured Crystal was for Ruby developers who want a good static type system.

Ruby 3 does static typing, so that would be the quickest path for static types. Crystal is interesting to me because its a systems language, using Ruby syntax and idioms. I'm a Rails developer by trade but I've been pining to go back into desktop GUI development. Right now the only viable cross-platform options seem to be Swing and Electron. I'm not sure what the desktop story is with Crystal but if it there is a wor…

Ruby 3 has static typing, but it's opt-in and doesn't affect the runtime. Here it's both enforced and directly translates to better performance.
Post reply on HN