4 ms·
Is ruby used outside of web dev (i.e., Ruby on Rails)? it seems like a nice cute language but I almost never hear about it.
by behnamoh 2y ago
Is ruby used outside of web dev (i.e., Ruby on Rails)? it seems like a nice cute language but I almost never hear about it.
- Trasmatta 2y agoDefinitely, although Rails is its most common use
- cempaka 2y agoAt my day job we use Ruby with Sorbet to stitch together a large number of data engineering pipelines. It's a good choice since we also often stand up small Rails apps to expose the results from those pipelines, so we can keep everything in one language. The fluent functional approach it enables is pretty nice for that business logic (but I would not want to do it without the gradual typing on top). We do find ourselves glancing over at the Python ecosystem with envy from time to time but overall it has worked pretty well. As I've gotten better with it I find myself reaching for irb for more and more one-off tasks in the shell too.
- Sinjo 2y agoOh nice! I haven't used Sorbet yet, but this is the second time I've heard good things about it outside of Stripe (where it originated). I'll have to give it a proper look.
- lucasoshiro 2y agoI think it's quite sad that Ruby is so associated with Rails. Ruby is one of my favorite languages and last time that I touched a Rails code was in 2017. Even in web dev Rails is not the only thing in Ruby, there's also Sinatra which is an elegant micro-framework for building HTTP APIs, similar to Flask. Some projects that I remember that uses Ruby that are not related to web dev: Homebrew, Metasploit, Vagrant and Jekyll. I also find Ruby very useful for shell scripts. I wrote a blog post about that some months ago, you can read it and the discussion about it here: https://news.ycombinator.com/item?id=40763640 https://news.ycombinator.com/item?id=40763640
- Levitating 2y agoCongratulations on getting Matz to tweet about your post.
- lucasoshiro 2y agoThanks! I never thought this would reach him!
- watercolorblind 2y agoSome other examples: DragonRuby, and Chef (which I prefer over ansible).
- UncleOxidant 2y agoI got into Ruby kind of early, around 2001. When Rails initially came out a few years later (circa 2004, IIRC) I remember being excited to see something putting Ruby out there giving it some publicity. But in a few years I think a lot of us were regretting the fact that most people's view of Ruby was formed by Rails.
- petre 2y agoYup, I wrote smartcard reader programs in it. Some of them talk to a http server using async-http. It can be used for anything that Perl or Python is good at, well maybe except data science because Python really shines there. And irb is massively useful for everyday tasks.
- cempaka 2y agoI wish I could reach for Kotlin as a kind of "Ruby with typing out of the box" but the lack of a good REPL is a real dealbreaker.
- Alifatisk 2y agoYou'll get Ruby with typings soon when rbs-inline is finalized
- Sinjo 2y agoOoh, I hadn't heard of rbs-inline before. I was always a bit put off by the type definitions having to live in separate files.
- cempaka 2y agoIs that really something that's been slated to be added to the language proper? I attended RubyConf and in his keynote Matz seemed pretty opposed to adding types to Ruby source, and argued in favor of automatic typing instead.
- petre 2y agoYou can always use Crystal or Dart if you want builtin types. I like Ruby the way it is an trust Matz with his language design decisions.
- cempaka 2y agoYeah I actually did not necessarily mean to dispute Matz's perspective there. I actually think it will benefit programming as a whole if at least one widely used language takes the path of trying to eschew explicit type annotations.
- Toutouxc 2y agoYeah, I use it for everything between 5-lines-of-bash and a needs-a-compiled-language. You almost never hear about it, because it's mature. No big controversies, no huge fuckups or new versions that break everything, just a steady trickle of improvements.
- AnthonBerg 2y agoI am happy in this moment because as I lay here with my ear on the ground, I can hear many many people hearing about Ruby
- baggy_trough 2y agoSure. I use it for almost everything, because it's so pleasant to use.
- Levitating 2y agoYes! In practice it's a scripting language similar in vein to Python, and it's used for similar things. It's actually the language of choice for a lot of OpenSUSE projects as well, like the Open Build Service. The reason you don't here much about it is because of its maturity.
- cess11 2y agoYou might have heard about Metasploit.
- Alifatisk 2y agoOh yes, Ruby is my go to language to use when I need to glue things together or when I want to automate tasks on my computer. It's such a pleasant language to use! I think the reason it's not talked about a lot is mainly because Rails overshadowing it and because there aren't so much hype or controversies around it.
- omoikane 2y agoRuby is my go to language for short "fun" programs, as there are many places where it optimized for development experience (such as the new "it" feature). One of the committers, Yusuke Endoh, clearly understood the joy of coding in itself as opposed to being means to an end, and has authored a book on esoteric programming: https://www.amazon.co.jp/dp/4774176435 https://www.amazon.co.jp/dp/4774176435 Before Ruby, my preferred fun language was Perl. Ruby is like Perl but without having to type $ all the time. I have never used Rails.
- segfaltnh 2y agoWe use it for microservices that only deal with Json and avro. Of course, we do that on Rails for some reason I'll never understand.
- thayne 2y agoIt's used for chef/cinc. I rather like that "recipes" use ruby with an edsl rather than yaml like ansible or salt.
- inopinatus 2y agoI use Ruby extensively in ops scripting and text mangling, where it supplanted Perl for me around about the same time that Perl stagnated ca.2010-2015. However, Ruby doesn't make sense to me as a general applications language (Swift & Kotlin have won me over from C++ & Java), or as a systems programming language (I'm still rusted on to C, pun intended), and I remain super ambivalent about Rails despite using it extensively to stick web interfaces onto things. That doubt is in large part because Rails frequently undermines the Smalltalk-ish heart of Ruby.
- dismalaf 2y agoVagrant, chef, puppet and lots of other stuff is written in Ruby. It's also great as a scripting language replacing Bash, Python or Perl for any number of things. I write all my small, one off programs in Ruby.