Live data from Hacker News

Ruby 2.6

anamaria.martinezgomez.name

71–80 of 164 posts

Re: Ruby 2.6

#71
post #38

Ruby used to be my most beloved language. I've since developed a strong appreciation for good type system. However, working with collections of any kind in Ruby is just such a joy. The methods around it are so well thought throug and make writing code a joy that in most other languages just would be tedious. On top of that the Ruby team is constantly working on making that aspect even better. I truly don't understand…

Try Crystal and you get the joy of Ruby enumerables together with a static type system.

Interesting. What’s your opinions on Crystal right now as a substitute for Ruby? Is there a good stack like Rails for Crystal?

Re: Ruby 2.6

#72
post #18
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.

I only skimmed over the linked resource, but non of the mentioned attack vectors and issues seem to be a problem for variable names in source code?

It enhances risks if you are doing things that are already risky, like using Ruby's dynamic facilities to either expose the user to things based on names in source (“eval” of user-submitted content, or things dynamically constructed from it, for example.)

But I can't see much else that is a realistic security risk (readability and code clarity risks are another story.)

Re: Ruby 2.6

#73

Is it a good time to learn Ruby? I mostly do React and Node + Java work professionally, but I've been looking into Ruby as a fun side project language. I would appreciate any anecdotes!

It is as good time as to, say, learn Farsi. It's beautiful, it's fun, learning it is a great experience, and, plus, quite a few people already enjoy speaking it. Or, you could learn something else without feeling much of a loss.

Re: Ruby 2.6

#74
post #38

Earlier quoted context omitted.

Try Crystal and you get the joy of Ruby enumerables together with a static type system.

Crystal is nice, but my love affair with Swift is going strong. Not exactly Ruby syntax but pretty similar in terms of simplicity. I am a Rubyist who feels right at home with Swift. But for the new year, I definitely want to give Crystal a fair shot!

Kotlin is my new love. Best collections library of any language I've used, great type system, coroutines are amazing, and all of it integrates perfectly with 25 years of rock-solid Java libraries.

Re: Ruby 2.6

#75
post #68

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?

> (Date.today..(Date.today + 1)) === DateTime.now #=> true It took me a minute to parse this. (I have never had this problem with Python or JS.)

Sorry - this is pasted out of the article, and refers to a change in the semantics of the === operator for Ranges.

Re: Ruby 2.6

#76

Ruby used to be my most beloved language. I've since developed a strong appreciation for good type system. However, working with collections of any kind in Ruby is just such a joy. The methods around it are so well thought throug and make writing code a joy that in most other languages just would be tedious. On top of that the Ruby team is constantly working on making that aspect even better. I truly don't understand…

Can you comment on why a good type system became so important to you? I can understand the value in interfaces but not really in any other context.

Languages without ADTs and Optionals just feel impoverished.

Re: Ruby 2.6

#77

Earlier quoted context omitted.

In Ruby it can easily be used to submit malicious source code to a repository (for example the reviewers thinking that a variable is set to some value, when in fact a new variable is created).

An attacker would still have to _do_ something with their new maliciously named constant, which would be as noticeable as any other malicious contribution. This is grasping at straws.

This is probably pretty overblown, but if a function takes a flag, it would be possible to pass in a different value to the function than appears to be passed in at first glance.

Re: Ruby 2.6

#78
post #74

Earlier quoted context omitted.

Crystal is nice, but my love affair with Swift is going strong. Not exactly Ruby syntax but pretty similar in terms of simplicity. I am a Rubyist who feels right at home with Swift. But for the new year, I definitely want to give Crystal a fair shot!

Kotlin is my new love. Best collections library of any language I've used, great type system, coroutines are amazing, and all of it integrates perfectly with 25 years of rock-solid Java libraries.

While the collections library may be better than others, it has a great many warts, many of which aren't discoverable until you've used it a long time. Some of these warts are a result of JVM interop requirements. It's not just the collections library, while the language is great and better than others, there are mounds of bugs and poor design decisions.

Re: Ruby 2.6

#79

Ruby used to be my most beloved language. I've since developed a strong appreciation for good type system. However, working with collections of any kind in Ruby is just such a joy. The methods around it are so well thought throug and make writing code a joy that in most other languages just would be tedious. On top of that the Ruby team is constantly working on making that aspect even better. I truly don't understand…

The only collection I wish Ruby improved upon is a simple Lisp style linked list. Kind of amazed JS has an easier way to do cdr than Ruby:

    const list = [ 1, 3, 4, 2, 8, 5];
    const [fst, ...snd] = list;
But I suppose that's just a result of JS implementing pseudo-pattern matching.

Re: Ruby 2.6

#80

Is it a good time to learn Ruby? I mostly do React and Node + Java work professionally, but I've been looking into Ruby as a fun side project language. I would appreciate any anecdotes!

Depends what you want to do, 90% of what I code in is python or Ruby, and I'll switch to C when I want performance. I've done a lot of rails (Ruby), Django (python), and flask (python) work in web development. Much prefer rails, eaiser, and better thought out. I have several websites with hundreds of thousands of visits a year, it is fine (all the frameworks are). I have had to do some inline C to speed up my Ruby in…

You should give crystal a go for the parts you need to be performant! You can even prototype those parts in ruby and easily convert to crystal when it becomes necessary. We’ve found a really nice balance, with business logic and interfaces in Ruby/Rails and crystal for AI/data processing.
Post reply on HN