Live data from Hacker News

Ruby 3.0 Preview 1

ruby-lang.org

171–180 of 207 posts

Re: Ruby 3.0 Preview 1

#171

If you interested in seeing how the 3x3 initiative* has come along, here are the benchmarks so far: https://github.com/mame/optcarrot#readme Personally, I am very excited for this release. * Matz's goal to get Ruby 3 to be 3x faster than Ruby 2. -- @sosodev Thanks for the updated info!

This might be a bit of a novice question, but will this affect the initializations of ActiveRecord objects in Rails anything?

For example, processing a large CSV file and inserting new rows in a database from it has always been extremely slow using Ruby/Rails unless you basically just write raw SQL that copies from the CSV and don't do any initializations of Rails models, #create, etc. I wonder if this will improve these things at all, but my guess is that it has to do with memory usage and not the speed of Ruby?

Re: Ruby 3.0 Preview 1

#172

Earlier quoted context omitted.

Why wouldn't you share your Ruby code with others? As a Ruby developer I an assure you, us Rubyists can work and understand each other's code.

To be frank, the language just isn’t boring enough. In my experience, a company’s code should be like the style of English used in an instruction manual. It should clearly and plainly express the business logic behind the company’s mission. Ruby is more like writing poetry. There’s nothing stopping one from writing boring , unambiguous, clear code in Ruby of course. As a Ruby developer, I’m sure your code looks very…

Add rubocop to your editor.

You can get it to discipline you as much or as little as you like.

Re: Ruby 3.0 Preview 1

#173

I left Ruby because the performance and security weren't improving and the community was slowly dying. I delved into Go before that got flooded with newbs, then looked at Crystal and Pony, before settling on Rust and Haskell for most things.

In 5 years I bet you'd "settle" into some other new shiny language with "better" everything. There'll be a more right tool for the job. Nothing wrong with that mentality, I just prefer to settle with my tool of choice and call it a career.

Re: Ruby 3.0 Preview 1

#174

Reactor model. Nice. Very nice. So real ruby multithreading at last. Okay time to upgrade to latest rails and wait for the multithreaded rails release. :P

I don't understand what you mean by "real multithreading". What I understand from Ractor is that it makes it safer to write concurrent code (e.g there are constructs that keep you from mutating shared data). But there is still a global VM lock, or is that gone in Ractor?

Re: Ruby 3.0 Preview 1

#175
post #21

My thoughts: - RBS: meh... might get more useful in the future (in 2-5 years maybe). - Ractor: Wohooo! I'm writing a DAG library where I was thinking of implementing something like this, good to know I can use it and get real parallelism on top. - Scheduler: :shrug: don't know about this one, might be relevant with future concurrent ruby code, any ideas? - Rightward assignment: it's a bit awkward but I see the use ca…

Latest talk about scheduler: https://www.youtube.com/watch?v=Y29SSOS4UOc Recent summary of scheduler, a little bit out of date (changes to interface): https://www.codeotaku.com/journal/2020-04/ruby-concurrency-f...

I will watch your presentation but if u could put my mind at ease: Is the scheduler a kind of event loop (like Node) implemented in Ruby? So if I wanted to use this thing everything I write would have to be callback based ?

Re: Ruby 3.0 Preview 1

#176

Earlier quoted context omitted.

Why wouldn't you share your Ruby code with others? As a Ruby developer I an assure you, us Rubyists can work and understand each other's code.

To be frank, the language just isn’t boring enough. In my experience, a company’s code should be like the style of English used in an instruction manual. It should clearly and plainly express the business logic behind the company’s mission. Ruby is more like writing poetry. There’s nothing stopping one from writing boring , unambiguous, clear code in Ruby of course. As a Ruby developer, I’m sure your code looks very…

I second adding Rubocop. But sure, Ruby has a way richer syntax and a higher freedom degree than a language like Go. It's part of what makes Ruby what it is. If high degree of freedom isn't something you want Ruby isn't a good choice.

Re: Ruby 3.0 Preview 1

#177

Reactor model. Nice. Very nice. So real ruby multithreading at last. Okay time to upgrade to latest rails and wait for the multithreaded rails release. :P

I don't understand what you mean by "real multithreading". What I understand from Ractor is that it makes it safer to write concurrent code (e.g there are constructs that keep you from mutating shared data). But there is still a global VM lock, or is that gone in Ractor?

I believe the VM lock is now per-ractor, so no longer global no. Then there are constraints on what can be shared between ractors to ensure safety.

Re: Ruby 3.0 Preview 1

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

I haven't watched this since I'm not into Clojure https://www.reddit.com/r/Clojure/comments/83j0hm/clojure_the... Just putting it out here to emphasise the point that ALL languages have controversial parts.

Re: Ruby 3.0 Preview 1

#179

>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…

Totally agree.Different approaches to the same thing won't add points to the language. P.S. the 'endless method definition' is meaningless, too. > def square(x) = x * x The original reason of this proposal was: > Ruby syntax is full of “end”s. I’m paranoid that the ends end Ruby. I hope Ruby is endless. --mame (Yusuke Endoh) It sounds like "let's add a new syntax for lisp because it has too many brackets"

> It sounds like "let's add a new syntax for lisp because it has too many brackets"

You'll find wisp [0] implemented for several of the larger Schemes. Often because the rationale for adding another syntax can be more nuanced and actually benefitial than a quick joke. [1]

Whilst you're right that caution absolutely applies when modifying a language's syntax, there may be a case for it that reduces friction for the programmer. The change might have been proposed with a joke. I doubt the entire rationale ended there, however.

[0] https://srfi.schemers.org/srfi-119/srfi-119.html

[1] https://srfi.schemers.org/srfi-110/srfi-110.html#rationale

Post reply on HN