Hacker News new | ask | show | jobs
by xutopia 45 days ago
Loco is a Rust framework that adopted all Ruby on Rails conventions and they're applied through and through. The naming of this project confused me.
2 comments

Rails has a ton of conventions but also implements a lot of patterns described in Patterns of Enterprise Application Architecture. People seem to forget the latter.
whoa cool can u elaborate more?
Josh is right. ActiveRecord, MVC, Front Controller(router + ActionDispatch), Template View(ERB) as well as a lot of what works under the hood in ActiveRecord comes from that book.

Though when I mean conventions I also mean where files are placed, how tables and fields are named, how migrations work and how DRY is part of the framework through and through.

A Loco app doesn't require fiddling with the database at all to replace its Rails counterpart. Hence why this naming of project confused me.

Try reading the aforementioned book, and look at the classes in the Rails API. They are often named very simply after the pattern.

For example, Active Record is on Page 160, and inspired https://api.rubyonrails.org/classes/ActiveRecord.html. Model View Controller is on page 330 and inspired https://api.rubyonrails.org/classes/ActiveModel.html, https://api.rubyonrails.org/classes/ActionView.html, and https://api.rubyonrails.org/classes/ActionController.html. Template View is on page 350, and inspired https://api.rubyonrails.org/classes/ActionView/Template.html.

Not all patterns used in Rails are so directly named, though. Layer Supertype is on page 475 and is behind the `class Company < ActiveRecord::Base; end` style. Single Table Inheritance is on page 278, and inspired https://api.rubyonrails.org/classes/ActiveRecord/Inheritance.... Repository is on page 322, and inspired https://api.rubyonrails.org/classes/ActiveRecord/FinderMetho.... Value Object is on page 486, and is a key part of https://api.rubyonrails.org/classes/ActiveRecord/Aggregation....

See also: https://signalvnoise.com/posts/3375-the-five-programming-boo...

My guess is this is where the "off" part of the name kicks in. As in they've left the tracks and are no longer on Rails. As in they've moved beyond the Rails paradigm but are claiming to be a spiritual successor to the original philosophy.

To paraphrase Doc Brown, "Rails? Where we're going, we don't need Rails."

This is Rails with the AI-equivalent of a hover conversion and Mr Fusion to address perceived limitations of Rails.