Live data from Hacker News

Crystal for Rubyists

crystalforrubyists.com

81–90 of 94 posts

Re: Crystal for Rubyists

#81
post #30

> 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.

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 list = new List`... I find myself thinking, "Why do I need to tell the stupid compiler in the very same line that a new List is a List? 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.

Re: Crystal for Rubyists

#82
post #62
post #43

Earlier quoted context omitted.

Generally I would agree, but in this case, "Crystal user" isn't that much better.

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.

Crystal dev

Problem solved

Re: Crystal for Rubyists

#83
post #75

Earlier quoted context omitted.

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.

> This is the problem 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 woul…

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.

Re: Crystal for Rubyists

#84

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. Despit…

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.

Re: Crystal for Rubyists

#85
post #68

Earlier quoted context omitted.

The rails creator DHH has indicated that rails would “absolutely not” be getting type support.

That's absolutely the correct call for rails.

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.

Re: Crystal for Rubyists

#87
post #53
post #34

Earlier quoted context omitted.

> 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.

And Elixir :)

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.

Re: Crystal for Rubyists

#88
post #46

Earlier quoted context omitted.

> 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. Pe…

With static typing and analysis in the editor there’s no reason to run the code for every second line you write. I usually only need to run it a few times towards the end of writing a feature to see if the compiler or specs catches any errors.

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.

Re: Crystal for Rubyists

#89
post #68

Earlier quoted context omitted.

That's absolutely the correct call for rails.

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.

There are solutions like sorbet[^1] and sorbet-rails[^2]. Have you tried them?

[^1]: https://sorbet.org/

[^2]: https://github.com/chanzuckerberg/sorbet-rails

Re: Crystal for Rubyists

#90
post #88

Earlier quoted context omitted.

With static typing and analysis in the editor there’s no reason to run the code for every second line you write. I usually only need to run it a few times towards the end of writing a feature to see if the compiler or specs catches any errors.

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.

Fair enough, I build json rest apis in Crystal, then someone else does the js/css front end.
Post reply on HN