Live data from Hacker News

RubyLLM: A delightful Ruby way to work with AI

github.com

51–60 of 182 posts

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

#52

Why is it using a global variable for this?

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 when you have zero or 1 parameter (I find it to be cleaner when you have a parameter, but have no opinion when there isn't a parameter)

In the example code from the link itself, you'll see:

  chat.ask "What's the best way to learn Ruby?"
which is the same as

  chat.ask("What's the best way to learn Ruby?")

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

#53

Earlier quoted context omitted.

Certainly a taste for global state, it seems.

Dogmatically rejecting global state even if it simplifies things in some particular case _is_ poor taste. Even a goto can be elegant sometimes.

Usually though it just creates long term issues, putting off important work to later.

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

#54
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

> It's worth remembering that the trolls that complain about Ruby do so because they care about it.

I don't think so. I mean there are complains about stuff you care about like people complaining about Healthcare. (edit: there are other forms of caring, see my grandchild comment)

Dissing on Ruby is definitely not this, they are not Ruby users wanting Ruby to be better. They don't even know Ruby apart from dissing on it is socially accepted, and makes them feel good.

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

#55

Earlier quoted context omitted.

Dogmatically rejecting global state even if it simplifies things in some particular case _is_ poor taste. Even a goto can be elegant sometimes.

Usually though it just creates long term issues, putting off important work to later.

Sometimes later never comes, so it's a net win compared to languages where you are forced do this important work now.

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

#56
The best Ruby always surpasses the elegance of the best Python... Unfortunately for practical means at this point I go for Python: more libraries, less problems with the C implementation of the interpreter (had issues with the GC in the past), better LLMs understanding of the code.

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

#57

Why is it using a global variable for this?

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 English. Code that reads like English > code that reads like math. (And you can still talk about functions of course.)

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

#58
post #54
post #36

Earlier quoted context omitted.

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

> It's worth remembering that the trolls that complain about Ruby do so because they care about it. I don't think so. I mean there are complains about stuff you care about like people complaining about Healthcare. ( edit : there are other forms of caring, see my grandchild comment) Dissing on Ruby is definitely not this, they are not Ruby users wanting Ruby to be better. They don't even know Ruby apart from dissing o…

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. Maybe they worked at a company where they replaced whatever their favourite stack is with Rails and they have hated Ruby ever since. It could be anything.

You wouldn’t keep responding to stuff you don’t care about at some level.

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

#59

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!

Ruby, specially with Rails, is particularly suited for AI coding, because of how mature it is and convention over configuration: Most of the important stuff is up to date in the model, and the entire thing comes with a fairy comprehensive set of ideas of how to to be used cohesively to built entire apps.

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

#60
post #54

Earlier quoted context omitted.

> It's worth remembering that the trolls that complain about Ruby do so because they care about it. I don't think so. I mean there are complains about stuff you care about like people complaining about Healthcare. ( edit : there are other forms of caring, see my grandchild comment) Dissing on Ruby is definitely not this, they are not Ruby users wanting Ruby to be better. They don't even know Ruby apart from dissing o…

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 form of opening to a social interaction, a form of self-reassurance etc. It is lot of things, and caring about Ruby at all is usually not among those (IMO).

Post reply on HN