Live data from Hacker News

Ruby 3.0 Preview 1

ruby-lang.org

151–160 of 207 posts

Re: Ruby 3.0 Preview 1

#152
post #85

Earlier quoted context omitted.

I have also strayed away from Ruby so I'm out of touch too. The arbitrariness helped get me into Ruby and helped get me out. It's cool if that's your sort of thing but as I get older I'm starting to dislike arbitrary things more and more. Anyway, I didn't realize who I was replying to when I replied to your first comment. I've seen a few of your presentations and read a lot of your work and I'm a fan.

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.

Re: Ruby 3.0 Preview 1

#153
post #95
post #84

Much as I would love to believe Ruby 3.0 delivers some kind of speed bump my simple test of doing what Ruby supposedly does best - parsing a log file with a regex - shows Ruby 16% slower than the Python equivalent. Ruby puts IO.foreach('logs1.txt').grep /\b\w{15}\b/ Python from re import compile with open('logs1.txt', 'r') as fh: regex = compile(r'\b\w{15}\b') for line in fh: if regex.search(line): print(line, end=''…

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?

Re: Ruby 3.0 Preview 1

#154
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?

Because what you’re really measuring is something like how well the block size the interpreter uses for IO matches the underlying os/hardware

Re: Ruby 3.0 Preview 1

#155
post #84

Much as I would love to believe Ruby 3.0 delivers some kind of speed bump my simple test of doing what Ruby supposedly does best - parsing a log file with a regex - shows Ruby 16% slower than the Python equivalent. Ruby puts IO.foreach('logs1.txt').grep /\b\w{15}\b/ Python from re import compile with open('logs1.txt', 'r') as fh: regex = compile(r'\b\w{15}\b') for line in fh: if regex.search(line): print(line, end=''…

The programs aren't doing the same things. The Ruby one seems to buffer the matches into a huge string then print. Don't know how different it would be but better to compare apples.

[deleted]

Re: Ruby 3.0 Preview 1

#156
post #84

Much as I would love to believe Ruby 3.0 delivers some kind of speed bump my simple test of doing what Ruby supposedly does best - parsing a log file with a regex - shows Ruby 16% slower than the Python equivalent. Ruby puts IO.foreach('logs1.txt').grep /\b\w{15}\b/ Python from re import compile with open('logs1.txt', 'r') as fh: regex = compile(r'\b\w{15}\b') for line in fh: if regex.search(line): print(line, end=''…

The programs aren't doing the same things. The Ruby one seems to buffer the matches into a huge string then print. Don't know how different it would be but better to compare apples.

IO.foreach without a block returns an enumerator.

Re: Ruby 3.0 Preview 1

#157
post #154
post #153

Earlier quoted context omitted.

If that's the case why is Ruby slower?

Because what you’re really measuring is something like how well the block size the interpreter uses for IO matches the underlying os/hardware

If they are both doing similar things and one is faster that's still significant. So Python's i/o is faster than Ruby's.

Re: Ruby 3.0 Preview 1

#159

Earlier quoted context omitted.

Metaprogramming is an important part of ruby, so method_missing stays.

No, metaprogramming is a stain on software engineering that all ecosystems are moving away from. Except Ruby.

based on what? if this is a feel, the you are a liar. go rust yourself
Post reply on HN