Earlier quoted context omitted.
Ruby fully typed would be awesome imo, but I know that goes against a lot of the fundamentals in the language. I just like the syntax and expressiveness of it, but coming from typescript, its just such a bad DX having to work in a large Ruby codebase.
> I know that goes against a lot of the fundamentals in the language. You're not the only person to reply with something like this but just to repeat, Ruby has had official gradual static typing support for 5 years now. Gradual typing is fundermentally already part of Ruby. Ruby could do with better static analysis tooling but people are being paid to work on that.
Do I not like Ruby anymore? (2024)
181–184 of 184 posts
Re: Do I not like Ruby anymore? (2024)
#182This guy is not up to date regarding the ruby language. Keyword arguments and destructing assignments are there.
Re: Do I not like Ruby anymore? (2024)
#183Earlier quoted context omitted.
> Yep, I agree with this. This is what I usually try in Python. Granted, Python is a way worse vehicle for FP than Elixir is, but I try to keep my procedures as pure functions as far as possible with not too big sacrifices in readability and performance. Most of the time a functional solution can be found, even in Python. That's really interesting. The last time I wrote any serious Python was back in the Python 2 era…
To be clear, Python is still no good for FP, when comparing to other languages, including the aforementioned Elixir. Even though the Python ecosystem is huge, few people if any seem to spend any thought on functional data structures. And also you wouldn't be able to use them like in typical FP languages, because you don't get tail call optimization. You can only try your best in Python.
Re: Do I not like Ruby anymore? (2024)
#184Earlier quoted context omitted.
> I know that goes against a lot of the fundamentals in the language. You're not the only person to reply with something like this but just to repeat, Ruby has had official gradual static typing support for 5 years now. Gradual typing is fundermentally already part of Ruby. Ruby could do with better static analysis tooling but people are being paid to work on that.
What do you mean with "gradual typing"? People want to know what data type a function takes and what a variable is. That's it really.
Ideally you would want your entire code base statically typed but if it's a large legacy project realistically you might not be able to stop all development work to do that.
Ruby 3.x onwards provides static RBS definitions for the standard library and allows you to statically type your own code too.
So the statement:
> I know that goes against a lot of the fundamentals in the language
is not correct. It's not against the fundermentals of the language, static typing is already part of the current ruby release and has been for sometime.
> People want to know what data type a function takes and what a variable is. That's it really.
I agree and both Solargraph and Ruby-LSP provide that today, as does the IRB REPL.
Unfortutately we have two ways of expressing static types and neither is perfect IMHO. My hope is that a new format, RBS-Inline, will solve that and unite the community.
As well as the developer experience I hope that having static types availible at runtime will also allow performance optimisations.