News for hackers. Stuff that matters.
Re:Ruby for eBook Publishing by dyingkneepad on Monday September 20, 2021 @12:45PM (#28595795)
Man, I love Ruby. I think it is much more elegant than Python and I really really wish Ruby would have taken the world instead of Python. That said, it's often the case where I want to do something where there's just no Ruby library for it (or at least not a maintained one) and there's a well known library for it in Python. Note: I do low level things, I don't do anything related to web or Rails.

Also, sometimes I start writing scripts for simple things, then they grow and at some point it's interesting to share them to my teammates, and they all immediately dismiss it since it's in Ruby. For that reason, I started doing all my work-related scripting in Python. But oh boy, it's always with that sad feeling of "I wish I was doing this in Ruby". Sometimes I think I should just not have learned Ruby and jumped straight to Python.

Re:Ruby for eBook Publishing by ash_while on Monday September 20, 2021 @02:12PM (#28596856)
I feel very similarly! Ruby just feels like such a well designed system from the ground-up. The object model is so elegant and consistent. The standard library is feature-full and fun to use, and the docs are excellent. Ruby is a beautiful object-oriented language but also leans into the power of FP with a plethora of functions defined on the powerful base-classes like Enumerable. In comparison, Python feels way less thoughtful, more of an ad-hoc language constructed through independent decisions over a long period of time
Re:Ruby for eBook Publishing by dyingkneepad on Monday September 20, 2021 @07:58PM (#28600542)
Yes, exactly! Even Python's object orientation feels like a hack made on top of a procedural language.
Re:Ruby for eBook Publishing by jacobsenscott on Monday September 20, 2021 @02:22PM (#28597007)
It just shows how "cargo cult" driven our industry is. Ruby was in. Then it was out, because it "doesn't scale". Then suddenly Python is in, even though it is has the exact same performance characteristics, give or take some constant value, as Ruby.
Re:Ruby for eBook Publishing by luibelgo on Monday September 20, 2021 @03:32PM (#28597822)
Languages look similar, but Python value resides in the vast amount of libraries available to do data processing and ML. Most of them backed by C implementations under the hood.
Re:Ruby for eBook Publishing by cutler on Monday September 20, 2021 @10:51PM (#28601596)
There's nothing about Python, compared with Ruby, that gives it any advantage, numerics or otherwise. Ruby's C ffi is just as powerful as Python's. It's all just a first mover phenomenon. Python is the VHS of programming languages.
Re:Ruby for eBook Publishing by luibelgo on Wednesday September 22, 2021 @01:40PM (#28619313)
Community matters. In this case Python community around data science is huge.
Re:Ruby for eBook Publishing by cutler on Wednesday September 22, 2021 @05:27PM (#28622065)
PHP, JS and Python all have great communities but they're still crappy languages.
Re:Ruby for eBook Publishing by Grimm1 on Monday September 20, 2021 @04:18PM (#28598427)
Exactly, and though Ruby has an FFI (Foreign Function Interface) similar libraries were not created and Ruby was pigeon holed as a language you build CRUD apps in.
Re:Ruby for eBook Publishing by rmetzler on Tuesday September 21, 2021 @12:26AM (#28602022)
There is a dev adding Ruby bindings via FFI to ML libs. Unfortunately it doesn't seem to be a large community (yet).

I don't do any ML and don't know much about it, but the Elixir / Phoenix people around José Valim now build ML software (nx, livebook) and I'm excited for this.

Re:Ruby for eBook Publishing by pjmlp on Tuesday September 21, 2021 @04:45AM (#28603139)
And those libraries can actually be used from any language with FFI capabilities.

So whatever headstart Python might have in machine learning, it is only a matter of time until all major languages support the same C, C++ and Fortran libraries.

The only things holding it, are having anyone that cares enough to write those bindings, and the culture of which languages are accepted when submiting papers.

Re:Ruby for eBook Publishing by mmahemoff on Tuesday September 21, 2021 @12:33AM (#28602068)
Software, like anything with money involved, tends to suffer from cargo cultism, but I think there's much more to it. Language ecosystems tend to be self-reinforcing in a cycle between developers and supporting libraries/tools.

Once Python got the edge in certain areas - particularly data processing - it was an upward spiral. The same can be said of JavaScript for webdev over Ruby and Python, with its special place at the heart of every browser.

I'm not entirely sure why Python got its initial edge for data processing. I think Google probably played a big role by sponsoring Guido and making it one of the key languages used internally and on App Engine. Ruby also had its share of drama and not everyone appreciates its "More than one way" (TMTOWTDI) philosophy.

Re:Ruby for eBook Publishing by stevekemp on Monday September 20, 2021 @01:26PM (#28596290)
I have to admit I've had a similar reaction, at a previous company we were "forced" to use Ruby to be consistent.

I grew to love Ruby, though I admit I always approached it with half a mind pretending I was writing Perl.

These days I've sometimes fallen back into Ruby, but then had issues sharing it with colleagues - so I've largely switched to Go. While most people don't have a dev-environment setup I can give them binaries built via github/gitlab/jenkins, and so sharing tools & utilities is just that little bit less painful than with Ruby (and even Python).

Re:Ruby for eBook Publishing by benbristow on Monday September 20, 2021 @05:07PM (#28599005)
I used to work somewhere where I got "forced" to use Perl but was more familiar with Ruby.

Obviously Perl came far earlier than Ruby and Ruby was heavily inspired by Perl (There's even a quick comparison on the official Ruby site here https://www.ruby-lang.org/en/documentation/ruby-from-other-l...) but it always felt like Ruby is such a nicer language to read and write and obviously due to age was just a more modern overall. You could define a class as a... class!

Whenever I wanted to make a quick script for myself for personal usage I'd always write it in Ruby.

I'm now in a C#/.NET role and love typed languages now but I'd never go back to Perl, but I still have a special spot for Ruby.

Re:Ruby for eBook Publishing by cutler on Monday September 20, 2021 @10:56PM (#28601634)
Perl got lost in arguments over whether to adopt a meta-object protocol (MOP) in the core and if so, which one. That and the endless variants of Moose just took TIMTOWTDI to ridiculous extremes. Meanwhile PHP and Rails were eating Perl's lunch.
Re:Ruby for eBook Publishing by strzibny on Monday September 20, 2021 @02:21PM (#28596994)
ruby-packer worked for my little Ruby things in that regard https://nts.strzibny.name/making-a-ruby-executable-with-ruby...
Re:Ruby for eBook Publishing by weaksauce on Monday September 20, 2021 @03:05PM (#28597470)
why not docker?
Re:Ruby for eBook Publishing by Glyptodon on Monday September 20, 2021 @02:23PM (#28597024)
I also think Ruby is so much cleaner and more productive than Python. I really miss it. The number of times I think "this is like a bad version of Ruby" while doing stuff in Python...
Re:Ruby for eBook Publishing by seiferteric on Monday September 20, 2021 @02:30PM (#28597103)
Perhaps we need a ruby <-> python transpiler so you can secretly program in ruby on python projects.
Re:Ruby for eBook Publishing by cutler on Monday September 20, 2021 @10:59PM (#28601647)
Especially with Python lambdas. Such a contrast with Ruby's elegantly-designed blocks, Procs and lambdas.
Re:Ruby for eBook Publishing by Shicholas on Monday September 20, 2021 @08:18PM (#28600666)
Another comment to piggy back off the ruby > python love. RSpec is a million times better than any testing library in python and bundler solved package management issues years ago that python still hasn’t solved. Glad to see I’m not alone!
Re:Ruby for eBook Publishing by seiferteric on Monday September 20, 2021 @01:32PM (#28596341)
I just the other day started working on an idea for a ruby based shell: https://github.com/seiferteric/rbshell . The idea is to try to write a ruby DSL that looks as similar as possible to regular CLI commands, but return ruby objects so you can more easily process the results. I would be interested in some help if others are interested. I haven't yet decided on the exact syntax yet but it is already looking kind of interesting I think.
Re:Ruby for eBook Publishing by subandi on Tuesday September 21, 2021 @05:15AM (#28603295)
I was just daydreaming about this the other day and would definitely give the finished project a spin. Depending on what you need (I'm a Rails dev, so pretty ok with Ruby in general but probably of not much help on the system end) I'd be happy to support you.
Re:Ruby for eBook Publishing by freedomben on Monday September 20, 2021 @01:37PM (#28596418)
neat, I started a similar thing in 2014 but just didn't have the time it needed. I sincerely wish you well on your effort! I'd still love to have a shell based on ruby.
Re:Ruby for eBook Publishing by Grimm1 on Monday September 20, 2021 @04:20PM (#28598470)
One of the major reasons Ruby didn't take off [outside of web] is because of the library availability. Ruby was pigeon holed by Rails while in Python I can reach for a library for pretty much any usecase and scenario from Genomics to Web.

The thing is that is an issue of community, because Ruby does have an FFI and there is really nothing stopping people from building libraries similar to how they're done in Python, calling out to C. They just didn't.

Re:Ruby for eBook Publishing by burlesona on Monday September 20, 2021 @09:15PM (#28601030)
I think this is largely because academia adopted python as a teaching language, and given enough time college students and faculty write a lot of library code.
Re:Ruby for eBook Publishing by pjmlp on Tuesday September 21, 2021 @04:48AM (#28603153)
Indeed, it was also one of Python's original goals, to be the next Pascal/Basic.
Re:Ruby for eBook Publishing by weaksauce on Monday September 20, 2021 @03:05PM (#28597464)
Yeah I love ruby too... why do they dismiss it if docker is there for them to get running quickly? python is just so janky to me
Re:Ruby for eBook Publishing by likeabbas on Monday September 20, 2021 @11:26PM (#28601802)
I must be in the minority. I strongly dislike Python, and I loathe Ruby. Give me a statically typed language any day of the week.
Re:Ruby for eBook Publishing by Torwald on Monday September 20, 2021 @01:17PM (#28596194)
Can you give me one or twoo examples for such missing low-level stuff Ruby libraries, please?
Re:Ruby for eBook Publishing by dyingkneepad on Monday September 20, 2021 @07:55PM (#28600525)
Two examples I remember researching Ruby for and ended up giving up: hardcore statistics stuff (I'm using using Python's scipy.stats now) and GUI toolkits (yes, there are some toolkits available, but nothing like Python's official bindings for gtk/qt).

It's hard to remember more examples. I remember having problems even with FastCGI on Ruby, but I ended up not writing the code at all so that won't count. Also something related to parsing emails.

Re:Ruby for eBook Publishing by gorgoiler on Tuesday September 21, 2021 @02:10AM (#28602423)
Ruby was in my blood, once. Mountains of systems integration and backend parsing and business logic. Never any Rails though.

The older and more boring I got, the more I liked Python. Young me and old me both knew what they were doing.