top | item 33763127

Crystal for Rubyists

217 points| sdogruyol | 3 years ago |crystalforrubyists.com

90 comments

order

unixhero|3 years ago

I fucking love Crystal and Ruby. Never has a language literally made me happy like those two. "Amazement wow is this how easy I can achieve this. This is incredible!!!".

Conversely Perl and C++ made me miserable, as I tried and tried and gave up learning them. I prefer Excel formulae to working with them.

nurettin|3 years ago

I pretty much love C++ and would give up my career to be able to work with it again. Especially that feeling of squishing millions of lines of data in milliseconds by running the compiled code. It is pure delight. C did make me pretty miserable, though.

cies|3 years ago

> Perl and C++ made me miserable

You compare to rather new, and "geared to learners", languages to some old and know-to-be-arcane languages.

I'd be curious what you think of, for instance, Kotlin and Elm.

gregors|3 years ago

It's quite easy for me to churn out some data munging scripts using Ruby but I was running into performance issues on large csv files. Crystal is like having super powers for csv parsing if you already have Ruby skills. I really think it's the sweet spot for the language.

compumike|3 years ago

This is great Serdar.

As an alternative to Chapter 2 I’ll also share https://github.com/compumike/crystal-docker-quickstart my project template which lets you get a Crystal (currently 1.6.2) dev environment running with just Docker. Good for kicking the tires, which is what I think your audience is probably wanting to do! And then eventually can install a binary package as you suggest.

beta-ziliani|3 years ago

Nice! It doesn't work in Windows native, right? Asking because newbies might come from there (although I bet most of them use WSL).

open-source-ux|3 years ago

Crystal is a lovely language. The language community is small though, and learning resources are also small. The story for Crystal is the same story for many programming languages: grow the interest of users, and find generous funding.

My impression is that not many Ruby programmers have switched to Crystal. The slow(ish) Crystal compilation will not please Ruby users. And Crystal for Windows is still in beta.

Despite these factors, Crystal is a pleasure to use - fast, readable, and a well-featured standard libary.

pizza234|3 years ago

> The slow(ish) Crystal compilation will not please Ruby users

I don't know what's the general opinion, but distribution for dynamic languages is a nightmare (and I'm including intra-machine, ie. switching between environments).

Personally, I'd be thrilled to trade off speed of compilation for distribution simplicity!

> My impression is that not many Ruby programmers have switched to Crystal.

This depends on the context of moving - professional projects, or hobby programming. Every once in a while somebody pops up saying that they've switched for hobby projects (mostly, scripts).

I'd love to switch, also professionally (that is, for certain parts of my professional project), however, lack of (release quality) parallelism is a dealbraker for me. It's mostly a matter of long-term trust - I personally don't trust a programming language that in 2022 doesn't support parallelism. Ironically, Ruby now has it (even if in limited form).

Development of 3d party libraries are also in vicious circle (few libraries -> few devs -> few libraries). Lack of (release quality) AWS SDK, for starters, is a dealbreaker.

postmodern_mod3|3 years ago

One minor note:

Crystal achieved basic Windows support as of 2021/11/18. https://github.com/crystal-lang/crystal/issues/5430

As of Crystal 1.5.0, Windows support is basically there. https://crystal-lang.org/2022/07/06/1.5.0-released.html

However, Crystal aims to support the lowest common denominator between POSIX and Windows, so not all of the Windows standard APIs are supported out-of-the-box. Other Windows specific libraries will need to be created specifically for Windows users/developers.

Tolexx|3 years ago

> The story for Crystal is the same story for many programming languages: grow the interest of users, and find generous funding.

it's the same thing for Elixir as well. they have successfully wooed a few Ruby programmers but not many have completely switched to using Elixir. Again some companies using Elixir are those that want to migrate away from Ruby.

it takes quite a while for a new hot language to become extremely popular and then go on to replace other popular mainstream languages.

nerdponx|3 years ago

To be fair, the slow compilation time is annoying even compared to other compiled languages, particularly Go and Nim, which are similarly "high level".

I also found that the Crystal LSP server was painfully slow, and there seems to be a lack of robust developer tooling in general. Has that improved in the last year or so?

azangru|3 years ago

> What’s awesome about Ruby?

> Dynamically typed

As someone who has experienced the joy and at least some feeling of safety from moving to typescript from javascript, I would seriously question that dynamic typing is awesome.

Edd314159|3 years ago

I reject the implication that if dynamic typing is awesome, then static typing is _not_ awesome.

It’s like saying pizza is awesome, therefore ice cream is not.

Both are awesome! It just depends what you’re trying to achieve at that point in time. A language’s type system is not, in absolute terms, an advantage or disadvantage. It’s just a design choice, each with their own trade-offs that we must consider.

trehalose|3 years ago

I tend to like when languages are dynamically typed, but I suspect it's not the dynamic typing I like--I think it's that dynamically-typed languages generally have type inference.

I don't like having to write things like `List<int> list = new List<int>`... I find myself thinking, "Why do I need to tell the stupid compiler in the very same line that a new List<int> is a List<int>? Wtf else would it be?!"

When I write in a language such as Kotlin, that's statically typed but has type inference, I feel basically the same lack of resistance as I feel working in dynamically typed languages. Of course, even in such languages, there'll be times when the coder must specify a type, or should specify one for various reasons, but I like when the compiler at least makes an effort, haha.

I like Ruby a lot (and I've tried out Crystal in some recreational programming stuff and like it a lot too), and I think I'd still like it just as much without the dynamic typing.

gregors|3 years ago

As someone who was on the type train in Uni and moved to dynamic languages, my first feeling was slow and unsafe. I couldn't imagine how things wouldn't just explode. In practice I've rarely seen issues. Ruby is still the fastest way for me to get a concept working. I'd definitely consider it awesome.

bryanrasmussen|3 years ago

not all dynamically typed languages are the same, Ruby is strongly typed and JavaScript is generally described as a weakly typed language.

Existenceblinks|3 years ago

This is the problem when people only know one language, especially javascript. And then have quite naive opinion about programming languages. Ones should try at least all one of big categories; one of ML family, one of C-like, one of Lisp dialect.

watzon|3 years ago

I've been using Crystal for some 6 years now and it's still my favorite language. It definitely has issues; it's not perfect, but it really hits a good balance between being a fast language with nice features and encouraging the "joy of programming" that Matz is all about. I would love to see it gain popularity eventually.

freilanzer|3 years ago

With advent of code coming up I'm torn between Kotlin and maybe Crystal.

https://adventofcode.com/

dengolius|3 years ago

Wow, I'm in with Crystal support :)

Do you know something like awesome-training resourses for Crystal?

nerdponx|3 years ago

Kotlin, Crystal, Nim, Koka, who can decide?

Serg31|3 years ago

Hey Everyone. I'm looking russian speaking Crystal/Ruby developers for really interesting project with competitive salary. For details, please, contact me via e-mail - veronika.p@eurekaos.com

singularity2001|3 years ago

How is wasm support going? I know they have to "throw away" many of their inventions in lieu of single threads and untouchable stacks, but the core of type inference still maps well to wasm (?)

raydiatian|3 years ago

> Crystalian [being the name for Crystal users/evangelists]

Man, there have to be better alternatives than this.

Did you try “crystacean?” Chuckles in .rs.

nix23|3 years ago

Pfff, yesterday i talked with a Brain fucker...it was terrifying. Can we just stop calling peoples after tools?

glenngillen|3 years ago

Crystian? ;)

aaaronic|3 years ago

Geodes?

austinjp|3 years ago

Hmm, perhaps Wyld Crystallyns?

chillfox|3 years ago

There are lots of alternatives. There was a large thread on the forum discussing it and there is basically no consensus for a preferred term.

_joel|3 years ago

Shardies

watzon|3 years ago

I opt for meth heads

tasqyn|3 years ago

you people must be fun at parties :)

Yahivin|3 years ago

Crystalizers?

rvz|3 years ago

Crynge.