Live data from Hacker News

Ruby 3.0 Preview 1

ruby-lang.org

161–170 of 207 posts

Re: Ruby 3.0 Preview 1

#161
post #153
post #95

Earlier quoted context omitted.

That's not really surprising since regex in most languages is PCRE and not really indicative of actual interpreter performance.

If that's the case why is Ruby slower?

Your Ruby snippet is slower for two reasons:

  - IO.foreach is lazy, but then you call `Array#grep` on it which allocate a huge Array
  - `grep` populate the "last_match" object, `String#match?` is much faster.
Try rifraf's snippet: https://news.ycombinator.com/item?id=24597067, it should be as fast as Python.

Re: Ruby 3.0 Preview 1

#162
post #152

Earlier quoted context omitted.

I think we're all really great in cherry-picking something lacking in a language and then describing the whole eco-system as bad. What language are you using now? Were there seriously no bad design decisions made in said language?

If you like dynamic languages I find it hard to pick out poor design decisions in Clojure.

Yes Clojure is the only language which surpasses Ruby in composability.

Re: Ruby 3.0 Preview 1

#163

>Rightward assignment statement is added. >fib(10) => x This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map/filter in standard library ! .NET went with non-standard SQL-like names (select/where) and I'm not a…

In a sense Ruby is sort of a cleaned up Perl but maybe not cleaned up enough. I fell totally in love with it almost 20 years ago but these days I think we have better languages to choose from even if their ecosystems aren't always as rich.

You mean like Dart and Go? For expressivity I'll stick with dirty old Ruby, thanks.

Re: Ruby 3.0 Preview 1

#164
post #93
post #20

So now there are basically no dynamically typed languages left. There's Scheme, JavaScript, what else? All languages nowadays are converging to TypeScript/Rust. It's kind of sad.

Julia, Python, Racket, Ruby, Common Lisp, Erlang, Clojure, etc... But in my opinion, dynamic typing is a terrible idea for production code.

All of those offer static type checking. Python and Ruby's don't necessarily change how the code is compiled, but it might in the future. Common Lisp declare/declaim/proclaim changes the way the code is compiled; it's not just a linter. Clojure is definitely not dynamically typed, unless you consider Java to be dynamically typed.

Also dynamic typing is more productive (for application code, not talking bootloaders here). It's a measurable fact and apparent to anyone who has written code long enough. Writing out types for everything is mostly pointless clerical work which should be able to be done by computers.

Re: Ruby 3.0 Preview 1

#165
post #131

Earlier quoted context omitted.

Ruby’s heavier use of key words rather than symbols saves it from the worst of Perl. Yes, there’s still some symbols, but nowhere near as many.

The "line noise" aspect of Perl never bothered me, because I'm already a heavy user of regexes. The cause of my misery was Perl's "There Is More Than One Way To Do It."

TIMTOWTDI is what I loved about Perl and the reason I found the transition to Ruby so enjoyable.

Re: Ruby 3.0 Preview 1

#166
post #20

So now there are basically no dynamically typed languages left. There's Scheme, JavaScript, what else? All languages nowadays are converging to TypeScript/Rust. It's kind of sad.

Is JavaScript dead? what the fuck is my browser running?

babel, typescript mostly and soon wasm

Re: Ruby 3.0 Preview 1

#167

I love Ruby and great to see Ruby love on hacker news. Just curious on how popular it is in the hacker news community ?

You know I've long stopped caring about how popular a language is in the community. As I get older the question I ask myself is do I honestly enjoy using it? If the answer is yes, then I put it in my programming toolbox and ignore the hype.

That's fine for personal use but professionally the main criterion is how widely the tool is used to solve business problems for paying customers.

Re: Ruby 3.0 Preview 1

#169
post #94

Am I alone in saying; for some damn reason, I don't like Ruby.. I appreciate what it can do, and indeed what it does.. I just feel like I slipped in between that moment to appreciate it more. I will go and spend some time to learn it more but out of a novelty aspect.. And that makes me feel bad.

No you're not alone, it's (surprisingly, to me) one of the more controversial languages. I love it. Lot's of people don't. These things are subjective, we don't all have the exact same brains and life experiences, us humans appreciate different things and that's fine.

Re: Ruby 3.0 Preview 1

#170
post #25

Earlier quoted context omitted.

RBS is optional.

It won't be optional in Ruby 4, most likely.

Yeah, I second the opinion that this remains optional. Ruby won't become a java-wannabe , that's a fight it cannot and would not want to win. Ruby is dynamic.
Post reply on HN