News for hackers. Stuff that matters.
Re:Ruby 2.6 by alfredmuffin on Monday December 24, 2018 @09:09AM (#18752191)
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!
Re:Ruby 2.6 by lettergram on Monday December 24, 2018 @09:34AM (#18752281)
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 a couple of instances - but that's very specific (and something you can easily do).

In terms of data science, python is my go-to and much more tooled for that kind of work. For any kind of desktop app I'll use C++, and for browser extensions / add-ons it's JavaScript.

Re:Ruby 2.6 by cknoxrun on Monday December 24, 2018 @01:51PM (#18753604)
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.
Re:Ruby 2.6 by jaxn on Monday December 24, 2018 @02:37PM (#18753851)
Oooh, that sounds interesting. Where would be a good place to start with Crystal assuming I specifically want to use it for AI/data processing with Rails business logic / interfaces?
Re:Ruby 2.6 by ksec on Tuesday December 25, 2018 @09:55AM (#18757617)
Crystal usage in actual Production ? Any pitfalls?
Re:Ruby 2.6 by jb3689 on Monday December 24, 2018 @09:29AM (#18752264)
Ruby isn't perfect but it's a great utility language and can do a lot of powerful things with very little effort. Read through Eloquent Ruby

The only problems I wouldn't go to Ruby for are CPU intensive ones or ones where I need parallel threads (which you already have Java for)

Re:Ruby 2.6 by Gravityloss on Monday December 24, 2018 @09:59AM (#18752393)
You can also use JRuby. Powerful and can be very easy to the user.
Re:Ruby 2.6 by jwdunne on Monday December 24, 2018 @11:24AM (#18752799)
Had a problem that I'd typically use Ruby for but needed to shed the GIL. JRuby worked beautifully. The only gotcha was I needed to use the JDBC driver for Sequel instead of the usual drivers. Obvious in hindsight but not so much with zero JVM development experience. I'd use it again.
Re:Ruby 2.6 by igouy on Monday December 24, 2018 @11:35AM (#18752853)
Re:Ruby 2.6 by hamandcheese on Monday December 24, 2018 @12:48PM (#18753237)
From the Truffle readme:

> TruffleRuby is progressing fast but is currently probably not ready for you to try running your full Ruby application on. However it is ready for experimentation and curious end-users to try on their gems and smaller applications.

> TruffleRuby runs Rails, and passes the majority of the Rails test suite. But it is missing support for Nokogiri and ActiveRecord database drivers which makes it not practical to run real Rails applications at the moment.

Emphasis mine, but that puts it firmly in the "fun toy" category rather than a viable technology for anything mission critical.

Re:Ruby 2.6 by igouy on Monday December 24, 2018 @06:01PM (#18754759)
> Emphasis mine

Do we think that's what `jb3689` meant by CPU intensive.

Re:Ruby 2.6 by maxfurman on Monday December 24, 2018 @10:19AM (#18752491)
I am a big fan of Ruby. The syntax and stdlib let you write code that is very close to a natural English sentence. For example, Ruby has both `if` and `unless`, so you can express a condition as `unless condition` instead of `if !condition`. And the frankly great Enumerable module provides a great collections API, miles ahead of Java in particular. If you're sick of writing for-loops I recommend giving Ruby a try!
Re:Ruby 2.6 by unixhero on Monday December 24, 2018 @09:11AM (#18752196)
It a language made to make you as a developer happy. So, yes.
Re:Ruby 2.6 by ascar on Monday December 24, 2018 @10:05AM (#18752423)
Ruby is awesome for prototyping. It's just incredibly fast to work with, because the language makes an effort to provide as much help as possible and adding as little obstacles as necessary. E.g. you can even add/change functions to/of Object, even during runtime, if you think it helps. Rails adds `blank?` like that, which is a helper for `nil? || empty?`.
Re:Ruby 2.6 by theredbox on Monday December 24, 2018 @09:11AM (#18752197)
As good as any time. You will loose a lot of performance when compared to v8 but the ruby paradigm is subjectively much more pleasant to work with.
Re:Ruby 2.6 by faitswulff on Monday December 24, 2018 @09:35AM (#18752285)
Enumerable methods are almos always what make me want to ditch Javascript for Ruby.
Re:Ruby 2.6 by zephyrfalcon on Monday December 24, 2018 @02:53PM (#18753930)
ES6 has map, filter, reduce, etc... and anonymous functions which can be used in lieu of Ruby blocks.
Re:Ruby 2.6 by jonahx on Monday December 24, 2018 @10:14AM (#18752465)
Have a look at:

https://ramdajs.com/

Re:Ruby 2.6 by lloeki on Tuesday December 25, 2018 @06:59AM (#18757097)
As a Ruby dev on the hiring market until recently Ruby seems to be in kind of the same spot as Perl some time ago: many new/existing Ruby/Rails projects are around, so it's kind of mainstream but not as much as PHP/Node/Java/whatever is which means less job offers, yet not quite niche neither, and there seems to be kind of a slight lack of Ruby devs around, and it can act as a differentiator, even for non-Ruby jobs. There's quite an interesting market dynamic at play here.
Re:Ruby 2.6 by gaius on Tuesday December 25, 2018 @03:19AM (#18756555)
Is it a good time to learn Ruby? I mostly do React and Node + Java work professionally

It can be fun and it's as close as Smalltalk will probably get to mainstream acceptance, but if you are hoping for a lucrative commercial skill then probably you have missed the boat. Ruby is mainly used for two what most would now consider legacy things, Rails based websites and Chef based infrastructure. There is still some money to be made in maintenance of course and will be for a few years but the sun is definitely setting on Ruby. But 10 years ago it was super-hot.

Re:Ruby 2.6 by xiphias2 on Monday December 24, 2018 @09:20AM (#18752224)
For me it is too much fun. I love that I can use most of the standard library without thinking / looking at the documentation, and not needing to wait for compilation.

But at the same time I hate that I love a language that performs so bad compared to being closer to the metal.

Re:Ruby 2.6 by rakoo on Monday December 24, 2018 @09:25AM (#18752239)
Have you looked at crystal (https://crystal-lang.org/) ? Very ruby-like, but has additional safeties and compiles to native.
Re:Ruby 2.6 by xiphias2 on Monday December 24, 2018 @09:55AM (#18752377)
It looks fun, but as I'm doing financial modelling right now, Julia may be a better fit for me, as it has very nice libraries as well.
Re:Ruby 2.6 by amalawi on Monday December 24, 2018 @11:21AM (#18752786)
You may want to check APL family as a possible option for prototyping at least.
Re:Ruby 2.6 by xiphias2 on Tuesday December 25, 2018 @09:57AM (#18757625)
APL itself looks really really bad language with bad documentation, no real libraries, non-existent type system, bad function names, and I don't see any GPU programming support in it. In the family Matlab is still the best (It can do Monte Carlo simulation on the GPU, and has a great library for different distributions), but it's still much slower language than Julia generally.
Re:Ruby 2.6 by faitswulff on Monday December 24, 2018 @09:34AM (#18752278)
What use cases do you have that are more performant in other languages?
Re:Ruby 2.6 by xiphias2 on Monday December 24, 2018 @09:44AM (#18752322)
Right now I'm working on financial time series modelling. I can't use numerical arrays because the model is not parallelizable. Also R / Mathematica are not good for these kind of stuff.

I'm thinking of trying out Julia, as it's dynamic but still has a lot of interesting libraries, but for now I just decided with working with small data, so actually I don't have performance problems.

Re:Ruby 2.6 by Koshkin on Monday December 24, 2018 @01:20PM (#18753416)
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 by joelbluminator on Monday December 24, 2018 @03:33PM (#18754134)
Almost has nothing to do with learning Farsi, great analogy otherwise
Re:Ruby 2.6 by empath75 on Monday December 24, 2018 @12:24PM (#18753097)
It’s a good time to learn any language if it has any popularity at all.