Live data from Hacker News

Ruby 2.6

anamaria.martinezgomez.name

161–164 of 164 posts

Re: Ruby 2.6

#161
post #42

This will be fun. I’m glad we now have some performance improvements to some common methods. For those considering playing with Ruby, you should! One thing I’m surprised not many has mentioned what makes ruby unique and awesome, BLOCKS!

I love ruby, but I kind of consider blocks an antifeature compared to, say, JavaScript arrow functions (where you can actually call return and not inanvertsntly break out of the entire enclosing function).

Re: Ruby 2.6

#162
post #141
post #83

Earlier quoted context omitted.

There's got to be more to it than "has / doesn't have nil". Lisp has nil, and I rarely if ever see an analogous error there, or even a type error. I have a hunch that single/static dispatch is what tends to cause more problems than merely the presence of nil. It's not nil, but how you use it.

"It's not nil, but how you use it." Can you elaborate on how multi-dispatch reduces the issue of nil/null? I also use static type (typescript) to prevent issues with nil and would like to know how I can achieve the same in a dynamic language.

You can prevent nil errors using contracts like in Eiffel and Clojure.

Re: Ruby 2.6

#163

I am always happy to unwrap my Christmas present from the Ruby team! Some questions about this release: - Are there any benchmarks for the new JIT? - Why was `(Date.today..(Date.today + 1)) === DateTime.now #=> true` false in Ruby 2.5? It seems correct that right now is between today and tomorrow. Is it because one is a Date and the other a DateTime?

fwiw https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Some of those Ruby 2.6 programs are faster with --jit and others are faster without --jit

faster or similar: nbody #2, fasta #6, fannkuchredux #2, spectralnorm #4

slower with --jit: binarytrees #5, pidigits #5, regexredux #3, revcomp #5, mandelbrot #2, knucleotide #1

Re: Ruby 2.6

#164
post #12

> non-ASCII constant names This is actually a security risk, avoiding all Unicode security recommendations. See e.g. http://websec.github.io/unicode-security-guide/visual-spoofi... All they did was open the floodgates: https://github.com/ruby/ruby/commit/f852af0e59899157ef695edc... no rtl checks, no spoofing, no mixed script checks, no normalization.

For URLs sure. I can’t see the problem for internal constants...

Identifiers are named identifiers to be identifiable. Unicode spoofs are not identifiable anymore. It's not rockets science.

Every name needs to be identifiable. Simply enabling XID_Start + XID_Continue for unicode violates all unicode security recommendations. See the recommended Unicode Security Profiles 1-5, http://www.unicode.org/reports/tr39/#General_Security_Profil...

ruby violates all of them. so do many other languages.

BTW identifiers are not just url's, mail addresses or variable names, but also usernames and paths (filenames, directory names). eg with RTL spoofing you can hide ../

nobody cares so far, esp. not Linux filesystems. Garbage in garbage out is a security risk. The old Apple HPFS at least normalized unicode, the new one is again insecure.

Post reply on HN