Earlier quoted context omitted.
DHH has no say in Ruby development. That being said, Matz also isn't a fan of static typing. Static type annotations exist in the form of RBS, but no one that matters in the Ruby eco-system is pushing static type annotations in .rb files themselves. Also, after seeing TypeScript, I'm very happy about that.
https://github.com/soutaro/rbs-inline I myself am unsure where I stand on RBS. I wouldn't mind more use of it in my gem dependencies, but would probably not like it if it was enforced everywhere. For now I'll stick with improving my test/spec-writing skills, and maybe some runtime type checking like https://literal.fun/
Ruby 3.4.0
261–270 of 282 posts
Re: Ruby 3.4.0
#262If I want to make a SSR site using Ruby, are there any good frontend UI libraries that make doing this easier? It’d be nice if there was some Ruby abstraction for writing HTML, CSS, and JS that makes building interactive UIs easier (possibly built on top of HTMX, AlpineJS, etc).
Do you mean like Hotwire? https://hotwire.io/
Re: Ruby 3.4.0
#263If I want to make a SSR site using Ruby, are there any good frontend UI libraries that make doing this easier? It’d be nice if there was some Ruby abstraction for writing HTML, CSS, and JS that makes building interactive UIs easier (possibly built on top of HTMX, AlpineJS, etc).
You might want to look at view components: https://viewcomponent.org/ https://evilmartians.com/chronicles/viewcomponent-in-the-wil... https://thoughtbot.com/blog/hotwire-turbo-streaming-viewcomp...
Re: Ruby 3.4.0
#264What does ruby do well that other languages don't? What is the niche it's trying to fill?
It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language. This makes it very suitable to write and understand complex scripts, because the reduced boilerplate means less cognitive overhead for the programmer. As a result, experienced programmers can be extremely productive with it. The well-known Rails framework uses this to great effect, however, some people argue that the…
That's not even close to true. Even setting aside APL and its descendants, even setting aside Perl, any of the functional programming languages like Haskell and Scala are less verbose.
(The relative lack of success of those languages should indicate why minimizing verbosity is a poor aim to target.)
Re: Ruby 3.4.0
#265I am most excited about the parser change, previously discussed here: https://news.ycombinator.com/item?id=36310130 - Rewriting the Ruby parser (2023-06-13, 176 comments) I remember being taught to use yacc in our compiler course because "writing it by hand is too hard". But looks like Ruby joins the growing list of languages that have hand-written parsers, apparently working with generated parsers turned out to be e…
I'm pretty sure the only reason people ever used parser generators is that it allows a language that vaguely resembles the formal description of the target language. I always found them very confusing to write, confusing to debug, and much less efficient than writing your own. It's actually pretty straightforward once you get the tokenization and lookahead working.
Re: Ruby 3.4.0
#266Earlier quoted context omitted.
...but ruby is whitespace sensitive too. It's hard to notice, because rules mostly follow intuition, but there're cases when not only a missing newline, but absense or addition of a space changes resulting syntax. Currently I remember only difference in parsing unary vs binary operators, like + and *, and ternary operator ? : vs : in symbols, but there're certainly more other cases.
There was a recent thread about parsing Ruby wherein I learned that the % quoting character accepts any character following it as the opening/closing delimiter https://news.ycombinator.com/item?id=42032212 > Crazypants.
Re: Ruby 3.4.0
#267If I want to make a SSR site using Ruby, are there any good frontend UI libraries that make doing this easier? It’d be nice if there was some Ruby abstraction for writing HTML, CSS, and JS that makes building interactive UIs easier (possibly built on top of HTMX, AlpineJS, etc).
Re: Ruby 3.4.0
#268Hope ruby 4 had static type system like typescript.
Re: Ruby 3.4.0
#269If I want to make a SSR site using Ruby, are there any good frontend UI libraries that make doing this easier? It’d be nice if there was some Ruby abstraction for writing HTML, CSS, and JS that makes building interactive UIs easier (possibly built on top of HTMX, AlpineJS, etc).
Also, you can check out the list of UI libraries for Hotwire https://hotwire.io/ecosystem/ui-frameworks
Re: Ruby 3.4.0
#270I want to try Ruby since the news of Rails 8 came out, but it's been so difficult that I just gave up. Installing Ruby on Mac and Windows and actually getting the 3.3 version required for Rails 8 was a huge mission and test of patience because every installer defaulted to older versions of both Ruby and Rails even one month after the release. And yes, even Docker required tweaking to get the versions and I had issues…
Use asdf ( https://asdf-vm.com/ ) to manage your Ruby versions. You should be able to do $ asdf plugin add ruby $ asdf list all ruby (you'll see 3.4.1, the latest is available) $ asdf install ruby 3.4.1 And now you can use Ruby 3.4.1 with no issues. Follow that up with $ gem install bundler $ gem install rails $ rails new ...
I used to use ruby a lot - mostly just because it's the nicest language for scripting things on unix. I can remember trying to get it set up a year or so ago and finding the process difficult (think I was using rvm).
https://github.com/rbenv/ruby-build/wiki#suggested-build-env...
probably good idea to point people here before they install ruby, since it'll compile for minutes then tell you it's missing a dependency, and you have to start the whole process over.