6 ms·
New Machine Learning Gems for Ruby
- fny 5y agoAwesome work. I tried something similar a while back, but I gave up once I realized the memory requirements for Ruby numeric primitives make it near impossible to massage large data sets in Ruby. Pandas and numpy skirt this with custom numeric types. I've seen some efforts to build pandas clones in Ruby, but none have come close to the performance needed to handle a few gigs of data.
- rgrieselhuber 5y agoThere is also Dask in the Python world for when Pandas can’t handle the data size.
- richard_todd 5y agoI think they were adding something like python’s buffer protocol to ruby3, which should pave the way for something like numpy if there is enough demand. I’m referencing https://bugs.ruby-lang.org/issues/14722 https://bugs.ruby-lang.org/issues/14722
- nitrogen 5y agoNumo::NArray has proven useful to me for working with audio in Ruby, though I haven't tested it with GBs of data in a single array.
- version_five 5y ago> Published January 22, 2020 Has any additional development happened since then? I was interested to see this, but less so if it hasn't got any traction over the past year and a half
- faitswulff 5y agoThis follow up was published in September, 2020: https://ankane.org/more-ml-gems https://ankane.org/more-ml-gems
- WJW 5y agoWith a total amount of 31 gems published within a year and this person having a lot more published libraries outside the ML space, how much time is available per gem for things like continued development, regular updates to new ruby versions and/or bug fixing? I can't help but think that having so many gems becomes unsustainable rather soon.
- forgingahead 5y agoAndrew Kane seems to be one of the most productive Ruby developers out there - he has a ton of open-source gems that solve real-world problems: https://github.com/ankane https://github.com/ankane He's done a lot of the hard-work for creating the tooling in the first place - the community can step in from here.
- cutler 5y agoBut will the community step in? I doubt it since Ruby gem output has dropped dramatically in the last couple of years. See modulecounts.com where Python output is about 10 times that of Ruby. That's the difference with the exponential growth of Python where you have the Python Foundation backing everything.
- mike_d 5y agoWhat community? The web development space has moved on to javascript and friends. Ruby was also big in the security community for a while, but almost everything new is in Python. I actually checked the comments on this post to see if there was some new big push for Ruby I was missing.
- cutler 5y agoHotwire/Stimulus hasn't reversed Ruby's decline, as far as I can tell. Nor have the promised performance improvements in Ruby 3 so Ruby's downward slide looks likely to continue. Revivals are a rare thing in programming language adoption.
- forgingahead 5y agoIt's definitely a good point, I myself have noticed production software in Ruby losing favour over the past 5 years. I'm not sure for the reasons on it as I no longer build greenfield apps for companies so don't have those direct conversations, but I still use Rails in my own personal projects and for our current SaaS.
- 5y ago
- awesomeusername 5y agoOne of my greatest disappointments in life is that programmers don't give a shit about the actual experience of using a particular language and it's ecosystem, and instead go full sheep mode and follow the crowd for whatever reasons they think are valid. I don't hate python but it's existence is the main brake slowing ruby down. I enjoy programming in Ruby. As the years roll by and I get more grey hairs the enjoyment I get from other languages descends to just toiling away and wasting one's life. Thank fuck for Ruby
- cutler 5y ago... and Clojure. These two stand out as the most elegantly designed creativity-enhancing programming languages. The rest are mainly a set of constraints. Python is the VHS of programming languages with its pathetic lambdas.
- truth_ 5y agoWhat do you think about Elixir in this context? Is it not "creativity-enhancing" enough?
- cutler 5y agoElixir doesn't have an array/vector implementation. Instead it has to borrow Eralng's ugly offering or hack Map with numeric keys as in PHP.
- beakerbreaker 5y agoThere is some exciting development on that front by building on XLA. https://github.com/elixir-nx/nx/tree/main/nx https://github.com/elixir-nx/nx/tree/main/nx
- cutler 5y agoSo I can get a cutting-edge PyTorch/TF multi-dimensional array with Nx but Elixir itself still has no basic built-in vector? I don't get it.
- ilyash 5y agoI see the discussion turns out to be general about programming languages. Here is my take: I am doing Ops (aka DevOps, aka system administration) and I was using bash and Python. I never clicked with Ruby. I was suffering. Constant thought "why is it so shitty?" Outdated bash doesn't meet any modern expectation from a programming language. Python, as other general purpose languages, was not created for Ops specifically. Running external process is a pain, data manipulation is with list comprehensions instead of more straightforward map() and filter() (or do non-idiomatic Python), quite a few other features missing which I would expect when writing small scripts. I think Ops people deserve better. Result - my own programming language - https://github.com/ngs-lang/ngs https://github.com/ngs-lang/ngs . Is it "better" language? Probably not. I do think it sucks less than others for Ops though.
- freedomben 5y agoIt sounds like we do very similar jobs and feel the same way about Python. I'm 97% sure you're going to stick with your own language, but for others seriously give Ruby a look. I absolutely adore Ruby as a scripting language. It's so easy and elegant to shell out to bash and do something with the output. When brevity or familiarity with bash is desired, variables like $? are there also (although there are generally less esoteric ways to do things). Running a simple shell command in Ruby is as easy as using backticks and having the output from the command returned to you as a String (and I always add a .chomp to strip the trailing \n)[1] Example: datestr = `date '+%Y-%m-%d-%H-%M-%S'`.chomp Worth noting too is that Ruby also has a fantastic one-liner command line syntax like perl and awk for example. Check out https://robm.me.uk/2013/11/ruby-enp/ https://robm.me.uk/2013/11/ruby-enp/ and https://benoithamelin.tumblr.com/ruby1line/ https://benoithamelin.tumblr.com/ruby1line/ Also the community is amazing. There are gems for almost everything, and really neat/fun projects like Ruby Warrior: https://github.com/ryanb/ruby-warrior https://github.com/ryanb/ruby-warrior I'll stop now, but suffice it to say Ruby is one of the best tool sin my belt, and I haven't even mentioned the number of times I've thrown down a simple single-file HTTP service based on Sinatra in record time ;-) [1] https://stackoverflow.com/a/2400/2062384 https://stackoverflow.com/a/2400/2062384
- ilyash 5y ago