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.
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.
I enjoy Elixir a lot but it feels like a tool designed for a whole different purpose. I don’t really know what that purpose it. It’s possible that my brain is just not well organized for the way elixir is laid out, but Crystal is so fluid with my brain.
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.
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.
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.
> 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.
> Personally, I'd be thrilled to trade off speed of compilation for distribution simplicity!
Technologies like Docker have made distribution a lot easier. I haven't used tools like chruby or rbenv since 2014 when I started using Docker because Docker manages your app's runtime environment. You pull down your built image on your server and run it. There's no complication, sprawling of version managers or surprises.
Personally I think having a fast dev feedback loop is critically important. It's something you experience hundreds of times a day as you're developing your project.
If you're building web apps chances are you want to see your changes frequently since modifying a model, controller action or view may yield a different UI state.
I'm constantly editing code then directing my attention to my browser to see the results. This is independent of CSS or JS changes that might be picked up by asset watching tools like esbuild or tailwind's CLI tool.
> distribution for dynamic languages is a nightmare
Weird statement. Software distribution generally is just a terrible mess, regardless of what sort of language it's written in. The one exception is JS, which happens to be dynamic and also has what is probably the most reliable and ubiquitous platform available—so much so that its distribution story is often credited, rightly or wrongly, as the only reason anyone actually uses it.
>> the distributor compiles for different platforms
Most people aren't doing that for you. There are lots of tools out there where you do need to still manually compile it yourself and make sure you have the appropriate dependencies which will still be painful. That being said, I agree that shipping a script can be a problem, but lots of people use Brew and that seems to work ok.
Okay. Sounds like you're on the road to a convincing argument against Ruby. (I myself have avoided Ruby in the past for similar reasons, despite other things about it that are attractive.) And gesturing towards Golang is really just highlighting a conscious design decision by the Golang team—who didn't have to design it as a static language in order to achieve the same effect; they're orthogonal issues.
Where does the generalization to dynamic vs. static languages come from?
> Github's Hub tool is a good example.
I gave an example already (a counterexample, that is—JS). Was there something wrong with that?
Yes, there something wrong with it, because the distribution of the runtime is done via binaries i.e. browsers. Using Go or Crystal is mimicking that level of ease. Ruby, or JS (which is more of a mess than Ruby even though the runtime is already distributed) are still a pain to share. No credit goes to the JS distribution system(s) nor the form that the code itself is distributed in for the most difficult bit being done by browser vendors bundling the runtime.
This another weird comment—for different reasons compared to the original. There are several statements where the truth status of the claims are hard to ascertain, because the statements they're part of are incomprehensible. The claims in the statements that are comprehensible are untrue.
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.
> 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.
I love Elixir, but it is an extremely niche language. It's great for network application, but just doesn't seem to be suitable for a daily driver language. Meanwhile crystal can fit all the bill: you can use it to write small scripts, you can write it for write long running service, you can write it to crunch data (the multi-threading feature of crystal is still an experiment though, but it works well for basic stuff)...
As I mainly use ruby for scripting, Crystal has been replacing ruby's role for me for 3+ years and I don't even find anything that really missing, except for maybe a decent ORM like Sequel.
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?
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.
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.
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.
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.
I’d hardly call ruby strongly typed. There is basically no way to verify anything statically so almost all issues show up in run time. Updating Rails or any gems on a production system is a nightmare where the only option is to have 20,000 unit tests and then hope nothing blows up when you release it.
It's the main reason I see Rails not lasting another decade. All the Rails apps I have been working on become almost unmanageable after 6+ years because keeping things updated on an untyped system is borderline impossible to do safely.
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.
Could you state the problem more concretely? Javascript is a cross between Java and Lisp, having a Java-esque C-like syntax, and lisp-like function-as-a-first-class-citizen behavior. Typescript brings it all the way to C#; so the C-like territory is firmly covered. An ML-family language, especially something like Haskell, would only reinforce the admiration for static types. Which languages would lead to the conclusion that dynamic typing is awesome? Lisps?
Oh god you are bending some broad aspects to back it up that Javascript has all of greatness from every other style of programming. No, it doesn't. I don't think it works like that. It's like a p10 of jack of all trade.
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.
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
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 (?)
A developer who uses crystal? Like a builder who uses a hammer is not a hammer-user ;)
EDIT: Wow that took a long time to realize what you meant...haha no, truly not good, and thinking about it my comment "A developer who uses crystal?" is now terrible too.
As someone from the US state of Michigan that has at least two competing demonyms, I actually find the idea of everyone using a different form based on preference to be charming.
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.