Live data from Hacker News

RubyLLM: A delightful Ruby way to work with AI

github.com

81–90 of 182 posts

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

#81
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.

That's very nice, but not in itself a good argument for language use. If you count using a system written in a language, then almost every programmer uses Ruby daily as both Github and Gitlab are written in Ruby. Similarly you probably interact quite frequently with (banking) systems written in COBOL, but nobody would call COBOL a popular language.

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

#82

Earlier quoted context omitted.

I’ve found the Ruby community really cares about DUX. Not sure why it’s not in other language communities

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.

For a certain type of taste.

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

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

No, they complain about it because they care about web development... That should be obvious.

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

#84

Looks useful. Allowing ai to eval() code or execute any sql statement would scare the crap outta me personally.

From searching the codebase, I can only find eval() used in the markdown and the specs.

You’re totally right that eval()’ing unknown code is terrible but it doesn’t look like the gem itself is doing that.

The usage of eval() is in a user written tool in the docs. Definitely a bd example and should probably be changed

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

#85
post #57

Earlier quoted context omitted.

> 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.

You might know this, but you can also do f.(args) or f[args] in the latter case. It's still a bit meh, but slightly less verbose.

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

#87
post #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.

[deleted]

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

#88
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.

It has dropped in popularity and has never regained the popularity it once held. Of the many developers who used to write Ruby (myself included), I would wager not many of those same people still do.

It's dropped in relative popularity, but the demand feels like it's still increasing to me (been doing Ruby professionally since 2006), just not as fast as some of the other languages.

Keep in mind the number of developers overall is rising rapidly still.

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

#90

Super interesting gem! `Document.search(query).limit(limit).map(&:title)` how do you defined the documents to search on?

That’s an example of what your code could look like. For example, you might have a Rails app with a Document model and have added search to that model via Searchkick. Then this code is called by the library to execute a search.
Post reply on HN