Live data from Hacker News

RubyLLM: A delightful Ruby way to work with AI

github.com

61–70 of 182 posts

Re: RubyLLM: A delightful Ruby way to work with AI

#61
post #42
post #5

Earlier quoted context omitted.

Matz said he designed Ruby to optimize for developer happiness, it’s just a core principle of the language since it was created

Happiness of a developer writing code can be a misery of a one having to read / debug it. I worked in ruby for a couple years around 2009 and having to deal with a code that implemented most of its logic via method missing is still one of the strongest negative memories I have about coding.

Another annoying one from that category is Ruby's forwarded methods. Since they're created via generated, injected code, you can't query which method it forwards to at runtime. Or not easily anyway.

Re: RubyLLM: A delightful Ruby way to work with AI

#62
post #57

Earlier quoted context omitted.

It's not. The method, RubyLLM.chat creates a new instance of the Chat object, as has been copied here: module RubyLLM class Error https://github.com/crmne/ruby_llm/blob/9825f4fea089b1b974961... If you're wondering about module RubyLLM. That's just how Ruby is often written. Addendum: Ruby does not require you to put the opening and closing parenthesis on a function to run that function, and it's not always put there…

> Ruby does not require you to put the opening and closing parenthesis on a function to run that function, and it's not always put there when you have zero or 1 parameter mind = blown I always liked how functionName denotes the function and functionName() calls the function, and then it denotes the result e.g. in JavaScript or in math. But just saying functionName to call a function makes the code read more like Engl…

It comes with the downside that if you want to pass the function itself around, you need to do f=something.method(:the_function), and then f.call(args). It's not a huge deal, but... meh.

Re: RubyLLM: A delightful Ruby way to work with AI

#64
post #36

Saw this gem of a gem on reddit earlier today and there were some trollish comments about no one using ruby anymore blah blah blah which quietly bummed me out. Surprised and Delighted to see it as #1 here on HN tonight!

It's worth remembering that the trolls that complain about Ruby do so because they care about it. You'll often see the same names coming back on every post to angrily insist that no one is interested in Ruby ...apart from them obviously because if they didn't they would be busy trolling something else. :P

I'm not sure what your point is. I care about Ruby and want it to die because I have worked on the Gitlab codebase, which is written in Ruby. It's a bad language and it stopped me being able to understand behaviours and fix bugs.

In contrast I have also worked on VSCode which is similarly huge but written in Typescript. Faaaar easier to work with, enough that I've been able to contribute a couple of medium sized features and several bug fixes.

So when people say "yeay Ruby" I try to discourage them because I don't want more Ruby code in the world that I might have the misfortune of having to interact with in future.

Re: RubyLLM: A delightful Ruby way to work with AI

#65
post #38
post #29

Earlier quoted context omitted.

Is position #10 in https://octoverse.github.com/2022/top-programming-languages bad? It ranks right after Shell (#8) and C (#9). Ruby is still a mainstream language, and it's fairly easy to find a Ruby job. Compare that to Clojure or Haskell.

Compare that to Rust. For all the hype it has, very few companies are shipping products with it. There are a few, but nowhere near as many as are using Ruby.

Yeah but look at the trajectories - Rust is one of the fastest growing languages and Ruby is one of the fastest declining languages.

Re: RubyLLM: A delightful Ruby way to work with AI

#66
post #48
post #38

Earlier quoted context omitted.

Compare that to Rust. For all the hype it has, very few companies are shipping products with it. There are a few, but nowhere near as many as are using Ruby.

You are probably writing this in a browser with Rust code in it.

Safari has Rust?

Re: RubyLLM: A delightful Ruby way to work with AI

#67

Earlier quoted context omitted.

I don’t really mean this to be derogatory toward people who enjoy other things, but Ruby is a language and ecosystem by and for people who have taste.

Certainly a taste for global state, it seems.

Don't forget ungreppable code! And what are type hints anyway?

Re: RubyLLM: A delightful Ruby way to work with AI

#68
post #15
post #2

Such a breath of fresh air compared to poor DX libraries like langchain

Would anyone happen to know of a similar library with as good DX but for JavaScript or TypeScript?

Perhaps something like https://llmjs.themaximalist.com/

Re: RubyLLM: A delightful Ruby way to work with AI

#70
post #60

Earlier quoted context omitted.

Usually people get huffed up about stuff they care about. Caring doesn’t mean wanting it to be better, it could also mean get worked up about. Surely a one-off comment about nobody using Ruby doesn’t mean you “care”, but if it is true that it is the same people who keep commenting, they obviously care. Is it because they are jealous of the beauty of Ruby/Rails, as a Rubyist I’d think so, but who is to say really. May…

Equating caring and wanting it to be better was a mistake on my part. It made my comment not true, and it made you worked-up. Sorry for that. All in all, I don't think that other forms of caring apply either. I think that parroting "Ruby is dead" doesn't mean that they care about Ruby, it's just a thing people like to parrot, without the meaning realizing in their heads. A form of bonding, a form of distraction, a fo…

Haha I am not worked up. I just care it seems.

I agree. Parroting some meme isn’t caring per se. But I was working under the assumption that the statement that it was the same names who keep doing it. If you say “Ruby is dead” 5 times a year it isn’t necessarily “caring” if it becomes 100 times a year there is something else at play.

Post reply on HN