Rails on the BEAM

9 points by soulcutter


rubys

I'm the author of the post; and to be clear, I did this to see if it could be done rather than with a clear purpose in mind. My original interest was in developing offline first capabilities for an existing Rails application, and has expanded into exploring deeper integration with JavaScript. https://intertwingly.net/blog/2026/01/28/Twilight-Zone.html shows a full stack rails application running in your browser, and then follows up with Visual Studio Code, Vite, and Rails running in your browser with HMR using web containers. https://intertwingly.net/blog/2026/03/16/Watch-Mode.html takes this further and runs system tests, all within your browser and served statically from github pages.

ryan-duve

I'm no expert on anything here, but my understanding is:

  1. The BEAM's magic comes from no shared state.
  2. Rails's magic comes from shared state being build on highly opinionated conventions made by the framework to free the coder up to focus primarily on business logic.

These two seem to not be compatible. How does the project reconcile Rail's requirement of backing state with a DB with the BEAMs requirement* that processes only communicate with messages? I see "For production, swap SQLite for PostgreSQL" but if this is used like in Ruby on Rails then I don't understand the benefit of bringing the BEAM in.


*Yes, yes, excepting ETS.