Earlier quoted context omitted.
I wrote Rails professionally for a few years back when that was THE de-facto tech for greenfield projects and new startups. At the time, I really enjoyed it, but I'd never written a modern-feeling typed/gradually typed language yet (C#, which I found really verbose and ugly, a lot of pre-ES6 JS and Ruby, some Lua + Python). I would never voluntarily write it again. Ruby/Rails completely falls apart in larger projects…
Another issue with writing rails is the "bug in production that would've been caught at compile" issue lots of people have. There's been multiple instances early in my career when I missed a nil guard somewhere that broke months later because someone else used the method and sent it a nil. Types are super useful because they also work as on-demand accessible documentation, and the compiler helps you figure out well i…
Ruby vs. Crystal Performance
121–130 of 151 posts
Re: Ruby vs. Crystal Performance
#122Earlier quoted context omitted.
Sorbet ? So you can't write maintainable dynamic code without basically making it static is what you're saying.
When you have +100,000 LOC written over many years by people with varying degrees of experience and familiarity with the language, Ruby/Rails becomes unmanageably difficult a lot faster than other languages. It isn't the only one though. Not that you can't have a great, large Rails codebase but the "guardrails" are a lot less present than in some languages and it can be harder to try to clean up the mess once it's ha…
Re: Ruby vs. Crystal Performance
#123Earlier quoted context omitted.
Lots of people are sure their stack provides an amazing experience, for example I don't get why you would choose node over rails. As for the performance: looks good for js, but quite a memory hog or am I missing something?
If all you are doing is writing API then you already don't need 50% of what Rails provides. If you are not into ORMs then you don't really need anything Rails provides at all.
Re: Ruby vs. Crystal Performance
#124I really liked Crystal some years ago, even used in a prototype. Soon I realized that despite its cute syntax and good performance, coming from Elm, I would prefer a simpler language with type safety, good error messages and very fast compile time. Maybe in the next years I'll experiment again, especially due to Lucky web framework.
May I ask what language you decided to move to instead?
Re: Ruby vs. Crystal Performance
#125Earlier quoted context omitted.
you obviously did not do metaprogramming in Ruby. Try it and you will never look at the "metaprogramming" capabilities of other languages in the same way. no offence to JS, but JS and a proper programming language are not even the same species.
For real metaprogramming try Clojure. It's another world entirely.
Re: Ruby vs. Crystal Performance
#126Earlier quoted context omitted.
>> and are also semantically very close >Sorry I super disagree with this. They look similar. Dig into it just below the surface? Start to model it formally? Not at all. I think you're missing the point. If 90% of Ruby code works in Crystal unmodified (even if it's because the standard library had to be rewritten from scratch), then the programmer experience may well be quite similar, regardless of how fundamentally…
> If 90% of Ruby code works in Crystal unmodified False, premise, since it's not the case at first place. 90% of your Ruby code will absolutely not work in Crystal unmodified.
Don't nail me on exact 90%, but for me it does. Nothing rails related though. Good example: https://news.ycombinator.com/item?id=23437035
However, I agree that the fundamentals/underlyings are very different. It's far from being like a python 2 to 3 migration.
Re: Ruby vs. Crystal Performance
#127Coming at Crystal from a Go and PHP development background, here are my thoughts: - The syntax is lovely. No, really. - I hate waiting for it to compile, especially compared to Go's compile time. - It's really young yet, and the ecosystem is just getting started.
Matter of taste; I find it horrible, just as I find Ruby syntax horrible. And I do not care about syntax too much generally (among my production langs are k and clojure) but I find this an eye sore; don’t know why but it is what it is.
Edit: aaah downvotes for an opinion :) Anyway, background; I maintained a huge Rails codebase for years; it was pretty much the worst thing I ever did (in 30 years of production coding) and that was pretty much down because how much I don't like the syntax. That doesn't happen often.
Re: Ruby vs. Crystal Performance
#128Earlier quoted context omitted.
This is the reason why I have to keep IntelliJ Idea Ultimate/RubyMine laying around. I don't have the greatest laptop, and run a lot of containers, so Jetbrains IDE's are generally a no-go for me and I stick to VS Code, but trying to develop Ruby/Rails without a Jetbrains IDE Is crippling. I think ctrl+click definition jump does work in Crystal and it has a decent language server.
That's good to keep in mind, I strictly write code in vim but if I have to pick up ruby again I'll give those IDEs a shot. I really like the sales pitch of rails, but as someone that almost exclusively writes in modern, compiled languages, it's really tough to adjust to ruby and be productive with it.
Re: Ruby vs. Crystal Performance
#129If `brew install crystal` is taking more than an hour to complete, in my case it was because llvm is a dependency and for some reason it was trying to compile it from source. If you manually install a precompiled llvm (you can do `brew install llvm` with some flags) it should skip that step during the crystal installation.
asdf plugin-add crystal https://github.com/asdf-community/asdf-crystal.git
asdf global crystal 0.34.0
It was painless. Other languages I've installed with ASDF must have had the same dependencies.Re: Ruby vs. Crystal Performance
#130I know this may sounds strange but I would not be surprised once Crystal reached 1.0 there will be a Ruby implementation written in Crystal.
[1] https://github.com/ffwff/lilith [2] https://news.ycombinator.com/item?id=21860713