34 comments

[ 2.9 ms ] story [ 31.4 ms ] thread
"I have no idea if it works or not because I haven’t yet tried running it. But it's 5x shorter!"
At first I thought this would be an interesting article, but as soon as they mentioned using an LLM to do the conversion I lost all interest. It's like saying "I wanted this done so I got my underling to do it, here is my story...". Like why would I bother to read it then, as it was clearly not you doing the conversion or putting any thought into it.
The point isn't about writing it but seeing difference and making probably suboptimal choice.

I mentioned in other comment that I reviewed it extensively. It's not a big project so outside of a few spicy bits it's mostly a web app.

I'd say that saying "not putting thought into it" is unfair. I didn't push the button and YOLO.

I did research about the tradeoffs and consequences. Snippets of Rust code vs Rails are the real thing and testability of Rust app is something I spent 2 months on.

As LLM enthusiast would say: context matters ;)

I'm not sure any language + framework prioritizes developer happiness as much as Ruby on Rails.
From whatever to Go ... hype!

From Go to Rust ... hype!

From Rust to Ruby ... the new hype!?

With an LLM. So next week he can write about JavaScript and the next.
To count lines of rust code:

fd . -e rs -uu | xargs cat | wc -l

Why not just:

find . -name '*.rs' | xargs wc -l

>But before I did so I researched first. I asked a few instances to analyse the project in terms of gains of complexity, stability, testability, etc., and while (obviously) stability would drop (no types in Ruby) it’s not that awful (Sorbet has types in Ruby!).

Is it not a rage-bait argument to say that not having types implies less stability?

Idk why people are shitting on you. So many LLM haters on here. It’s changed the game completely and some people just don’t want to accept it.

I think this is cool. Verbosity of languages is important when it comes to coding with AI. I’ve found Go to be a happy medium.

This defies belief. “I wanted to scratch a technical itch. My local AI completed the job in 30 minutes. I never pressed Start to see if it works, but I did write a blog post about it…”
I did however review it over 5 hours. So ¯\_(ツ)_/¯
2016 check out my new JavaScript Library!

2026 check out the work I didn't write!

2036 how I've written 200 lines in this ancient Latin called C

2037 using humans to accelerate your token throughput by a fellow LLM (the 7th method will surprise you)
I built a set of gems (propel_rails) that takes the already terse Ruby on Rails code to the next extreme. It generates a set of top level classes like an API controller and some concerns that then create a full restful resource (model, controller, serializer, unit and e2e tests) with 0 boilerplate code. The controller ends up being only a list of all permitted attributes the api will accept because the restful actions are automatically generated. It’s a bit hard to fully describe but the meta programming power of Ruby really does make amazing things easy.
If you can switch from Rust to Ruby, and it would make sense, choosing Rust in the beginning was a mistake.
Thats a great summary of the piece and a reason why I decided to share.
I do wonder if it'll ever be possible to get Rust tests to feel as nice to write as, say, test suites in Python or Ruby. I might just be missing a lot of helpers, but a part of me really wants to use a test metalanguage that (for example) RC's everything, gives me implicit casts from strings to what ever type I need, and a bunch of other stuff.

I've always found Rust object buildup to be pretty annoying.

People think Ruby is slower than Rust, they'll be surprised to know Ruby is actually now faster than python but slower than Go or Rust.
I'm sometimes amazed by project sizes, a 30k line codebase is small? I'm aware that the ceiling is high but 30k lines of code can encode so much information and behavioural nuance.

Maybe this is just my backend/network focus with Golang though. Scaling beyond 10-15k lines of code always was quite intimidating as it is usually where I lose the ability to just keep a model of the codebase fully in my head.

> So I had to take a look around to remind myself what Ruby and Ruby on Rails are doing nowadays. They’re doing quite well.

Ah really?

Well ... let's look at TIOBE. Now I am aware that TIOBE sucks, it makes little sense, but even with that in mind, the claim that ruby is doing that well is simply factually WRONG, at the least right now:

https://www.tiobe.com/tiobe-index/

Ruby is ranked 23.

Rust is ranked 15.

Again, TIOBE has tons of issues, people pointed that out, but I am pointing here more at a trend. If you look at the graph:

https://www.tiobe.com/tiobe-index/ruby/

It is more obvious.

Now, I think ruby is a great language, I use it daily as the primary glue language to do literally everything. I call it the ultimate wrapper over C, which ruby ultimately is. But the claim "ruby is doing great" is just simply INCORRECT. And we haven't even gotten to RubyCentral mass-purging developers or adding random new corporate-driven rules to rubygems.org and what not. I never understood why I would be under 100k download restrictions when on github I have full control over my own (!!!) code. I call that an illegal hijacking attempt by RubyCentral (this was about a year before they mass-purged developers anyway, so I could nod my head wisely when that happened lateron, even though I had no advance knowledge, but it did not surprise me once the shopify corporate overlord pulled rank; and DHH sitting on the sidelines making joyful comments at the chaotic situation here on his blog. At that time I noticed that DHH indeed became a problem too).

> There are some typing initiatives (Sorbet), and the language itself is terse as ever.

No sane rubyist uses that typing crap, sorry. And matz isn't the biggest fan of slapping down mandatory types onto everything either. People whose brain is addicted to types, want them; I understand that problem. There is no way you can reason with them because they really WANT types. It's like someone starving for food; that person wants food. There is no way around that. Same with types for these people. And they want to change a language to that too. This is the annoying part. Many years ago I was surprised to hear haskell folks not wanting everyone. After that type addiction, I realise the haskell point of view: some people want to ruin languages. (You may debate whether types ruin ruby or not, but the main point here is that some people want to change a language into something that fits their brain more easily. Now I understand the haskell point of view, despite still thinking this is a snobbish elitist view of exclusion. But language integrity is also indeed important, so I understand that point of view these days.)

> while (obviously) stability would drop (no types in Ruby)

Absolute rubbish nonsense. Absolute. Totally incorrect claim made, from A to Z. But again, you can not reason with these type addiction people. Can't they go to PHP or some other language?

Let's reword it more neutrally then. Which claims and proof support the claim that stability drops because of "no types in Ruby"? Because I never ever had that happen in any code I wrote in ruby in the last +20 years. Yes, you need to be able to query what is possible; often you may have to do .is_a? or .respond_to?. Yes, this is not the same as "advance" type checks. I am not saying types are useless either. What I am saying is that the claim of "you lose stability without types" is ABSOLUTELY RUBBISH NONSENSE. But the brain of type-addicted folks is already set towards "types everywhere". This is the problem. They are trapped in their world of assumptions.

> So in the end it seems I have (licks finger and turns to the wind) 1.47x better outcomes if the app were a Ruby on Rails app instead.

Now he is...

> So in the end it seems I have (licks finger and turns to the wind) 1.47x better outcomes if the app were a Ruby on Rails app instead.

Am I reading this right... did this number just come out of thin air?

Is this just generated based on the vibes of the AI?

Also, to just add them up and compare them like that is just compounding nonsense on nonsense.

Hey I'm in the same boat!

I love Go and Rust, they're wonderful languages with their own ups and downs. Sadly I never was able to build a SaaS app with either. Something about a square peg and a round hole... I could be very wrong, but there's a lot of gadgets that come with a SaaS tool, and I'm not inventing them.

RoR is.. "good enough". I can opt-in types whenever, I can build things quick, the tooling is alright, etc.

My first real job was PHP, and there were just too many gotchas there. Ruby seems to steer a bit more towards ecommerce, which intruiged me. And its good enough for Shopify, so...

Curious if there are folks (perhaps from ruby community) using crystal for medium/large projects. How has your experience been?

I recently tried it out in a hobby project and was pleasantly surprised at how smooth the overall DX was, and how little memory it consumed.

Is there such thing as rails for crystal?
Mounting Debian from LAN on GRUB as bootloader, which is typical for x64_86 motherboards. Iterating /src/ is transforming language in compiler.
Trigger alert - While it is good to signal your 900+ IQ to the peasants around you,many many smart and talented developers don't like rust so much so that they'll prefer writing their own programming language and their own compiler over writing single line of Rust.

Jai and Odin come to mind with Jonathan Blow and Ginger Bill.

Many many more folks that are capable of (and have) written widely used beautiful libraries and frameworks that are evidence of their creativity and depth but we don't want to waste space here.

Rust however has a lovely Macho club a good brotherhood.

> Rust is verbose

It's really not that verbose. I rewrote a Python project in Rust. It was about 10% more lines of code. If they're seeing a bit difference it's definitely an outlier or they're doing something horribly wrong.

sorry for the bluntness, but you should have probably thought twice before hitting the send to Hacker News button, i didn't find this in any way interesting and i am definitively not a LLM hater
I always check hn comments before viewing the article . The comments alone saved me lot of time for not viewing the article
Claude works in Rails apps extremely well. As the author of this blog points points out, Ruby allows you to get a ton done with minimal coding. Also, Rails uses convention over configuration, making Rails apps even terser.

One hypothesis for the effectiveness of Claude writing Rails apps is its token efficiency.

I ran across this project awhile back that attempts to measure and compare the token efficiency across projects, and Rails does really well:

https://felipemrvieira.github.io/SyntaxTax/dashboard/