Live data from Hacker News

Ruby 2.6

anamaria.martinezgomez.name

131–140 of 164 posts

Re: Ruby 2.6

#131
post #106
post #38

Earlier quoted context omitted.

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

Crystal is definitely not production ready, I mean a language without thread support...

Thread support in interpreted languages isn’t that parallel to begin with.

Re: Ruby 2.6

#132
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.

What do you use Coroutines in a static language like Java, for ?

Re: Ruby 2.6

#133
post #106

Earlier quoted context omitted.

Crystal is definitely not production ready, I mean a language without thread support...

Thread support in interpreted languages isn’t that parallel to begin with.

JRuby threads are fully parallel and in production use today. CRuby's GIL is an implementation choice rather a property of dynamic/interpreted languages.

Re: Ruby 2.6

#134

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…

Oh boy, you are in for some treat if you try Clojure. But be warned, love for Ruby will be gone.

Re: Ruby 2.6

#135
For when Ruby 3.x?

They should release soon, if we are to start seeing some decent adoption by 2028.

/pythonicsarcasm

Re: Ruby 2.6

#136
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'm not so sure about the block thing. I mean I like having first class function-like objects, but you've got blocks and procs and both of these are different from bound and unbound methods. I would prefer that there was a single function type, personally. I wonder if I'm missing something, though. Is there an advantage to distinction between blocks and procs that ruby makes?

A block is a proc.

```ruby

def foo &bar

  return bar
end

foo {}

# => #

```

But I do agree that I don't quite understand the need for the distinction between procs and methods, or the need for unbound methods; I would think that methods could just be either bound to one object or another, as unbound methods are useless for the fact that they won't work at all unless they are bound.

Re: Ruby 2.6

#137
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!

> what makes ruby unique and awesome, BLOCKS!

Similar to blocks in Smalltalk and Self, surely?

Still, having worked with ruby a fair bit the past year, it does deliver much of what Smalltalk does (not surprising, as ruby borrows heavily from smalltalk).

https://www.gnu.org/software/smalltalk/manual/html_node/Invo...

Re: Ruby 2.6

#138
post #137
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!

> what makes ruby unique and awesome, BLOCKS! Similar to blocks in Smalltalk and Self, surely? Still, having worked with ruby a fair bit the past year, it does deliver much of what Smalltalk does (not surprising, as ruby borrows heavily from smalltalk). https://www.gnu.org/software/smalltalk/manual/html_node/Invo...

[deleted]

Re: Ruby 2.6

#139
post #74

Earlier quoted context omitted.

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.

What do you use Coroutines in a static language like Java, for ?

Everywhere I used to use CompleteableFutures, except without ending up with completely unmaintainable code.

https://github.com/Kotlin/kotlinx.coroutines/blob/master/cor...

Re: Ruby 2.6

#140
post #130

Earlier quoted context omitted.

> I can totally imagine new devs just trying out non-ascii variables, see it not crashing and then actually writing all their code using constants. Ruby already supported non-ascii identifiers for variables; 2.6 added support for non-ascii first characters of constants, which must still be capital letters, as had always distinguished constants from variables. It doesn't make anything non-ascii a constant, it just mak…

I wasn't aware of non-ascii variables. I was thinking about UTF support for Japanese characters, when I read the change. There is no concept of lowercase/uppercase. 日本語 is this a constant or variable?

Since constants are the exception, and used to require an ASCII capital but now can start with ant capital, an identifiers starting with a Unicode character in a script that doesn't have upper/lower case distinction is a variable, not a constant.
Post reply on HN