News for hackers. Stuff that matters.
Re:Web apps built with Ruby on Rails by kamikazeturtles on Friday January 10, 2025 @11:30AM (#42657119)
While I like frameworks like Rails and Django, Golang with AI makes me very productive. Especially because of how Golang codebases don't use too many dependencies so an LLM never recommends code that has an old dependency or mismatched version...

I'm just curious, how well does Ruby integrate with AI tools?

Re:Web apps built with Ruby on Rails by two_cents on Friday January 10, 2025 @12:12PM (#42657550)
I don't have a lot of experience with Golang and AI, I think Rails can give you different kind of productivity.

From what I know (please correct me if I am wrong) most people use AI to create scaffolding and automate all boring and repetitive tasks in a project. So code still needs to be written, you just outsource it to AI helper.

In Rails you write less code and concentrate on business logic because everything boring like DAL, authorization, caching is already written and tested in production.

edit: syntax

Re:Web apps built with Ruby on Rails by bb88 on Friday January 10, 2025 @11:50AM (#42657322)
A singular data point here, but if I ask MS Copilot to write me a unit test in python/django it will more often get it right the first time than in golang. The golang code tends to reference things that don't exist. These aren't huge codebases either.
Re:Web apps built with Ruby on Rails by kyrylo on Friday January 10, 2025 @11:47AM (#42657295)
I like Golang too, I use it whenever I can.

I haven't done any AI with Ruby, but from what I saw, the ecosystem is lacking support of good libraries.

Re:Web apps built with Ruby on Rails by correlator on Friday January 10, 2025 @11:36AM (#42657183)
This is a great point. I often ask LLMs which coding language they are most proficient in, and Python is the most typical response. This has makes me want to write more Python.
Re:Web apps built with Ruby on Rails by hansvm on Friday January 10, 2025 @11:50AM (#42657326)
Keep in mind, LLMs can't introspect. They integrate your prompt with their training data.

If Python is an extremely popular programming language people like to write about using (it is), you'll expect a lot of people to state that Python is their most proficient language and for that to make its way into the training data. When you ask the LLM, you'll get Python as an answer some fraction of the time and other languages some other fraction.

Those answers are orthogonal to how good the LLM actually is though. In the training data, you'd like a sufficiently robust sample of code (which Python should have) without most of the code being terrible (which Python doesn't have in the wild).

Mind you, IME they do better with Python than very new languages, and they do better with Python tooling than whatever maven build garbage you might have to deal with, but that's faint praise.

Re:Web apps built with Ruby on Rails by bb88 on Friday January 10, 2025 @11:51AM (#42657335)
I use MS Copilot in python and it's really good. Particularly at writing unit test cases.

Unit tests are a major win for LLMs.

Re:Web apps built with Ruby on Rails by holdenweb on Sunday January 12, 2025 @06:58AM (#42672934)
Does it understand pytest, do you happen to know by any chance?
Re:Web apps built with Ruby on Rails by bb88 on Sunday January 12, 2025 @10:25PM (#42679770)
It does indeed.

It seems to understand the way you want your unit tests written. So if you have a particular style, it's best to write one or two tests in your style, then it will use that same style when it starts writing tests.

You can do prompts like "I need unit tests for the exceptions that are raised in the SuchAndSuch.function()", and it will do it -- particularly if you have a unit test already written similar to what you'd like.

Re:Web apps built with Ruby on Rails by fchief on Friday January 10, 2025 @11:36AM (#42657179)
It works great with AI tools. Checkout the LangChain or Boxcars gem.
Re:Web apps built with Ruby on Rails by Zanfa on Friday January 10, 2025 @03:47PM (#42659995)
Not sure about Ruby in general, but Rails is an excellent candidate for LLM assistance. It’s very much convention over configuration, been around since forever and there isn’t a question somebody hasn’t already asked on Stack Overflow.
Re:Web apps built with Ruby on Rails by throwawaymagic on Friday January 10, 2025 @03:57PM (#42660122)
This is the thing when people say "LLMs write the boilerplate code for you"--why are you writing all that boilerplate? If you're dutifully cranking out boilerplate instead of creating abstractions that make it unnecessary to write boilerplate, you're a mediocre engineer at best. Add an LLM, and now you're a mediocre engineer with a mediocre simulation of a mediocre engineer.
Re:Web apps built with Ruby on Rails by Zanfa on Friday January 10, 2025 @04:41PM (#42660592)
Aren’t most business apps almost exclusively glorified CRUD? Like the sort of CRUD stuff Rails is amazing at. Those are basically all boilerplate, it’s more of a question of which flavor of boilerplate you need for a given use case.