crails

CRails — Clean Rails - The most beautiful compiled web framework

CRails — Clean Rails

Current status: a port of Ruby on Rails. At this point CRails is simply a port of Ruby on Rails to Crystal. We are porting the framework in its current form: the framework itself, its spirit and the beauty of its code. The code is being ported from Rails one-to-one, so that refactoring can happen later — this is a draft, not even a first release.

Philosophy

The project's philosophy — explicit contracts first, lessons from Rails and Ruby, why Crystal and not Rust, and the promises the framework intends to keep — lives in IDEA.md. It is effectively a roadmap and a promise for the future, not a description of what is already implemented.

The best performance in class

Median RPS, official once-campfire-verification harness, AMD Ryzen 9 3900X stand:

Route Rails Express Go Rust C Elixir CRails
room_show 1 731 10 430 14 316 21 953 31 698 2 346 38 092
messages_page 1 641 16 248 14 336 21 539 32 114 2 480 37 553
sidebar 1 804 19 979 14 945 24 411 34 857 2 566 52 299
search 1 801 17 764 15 988 25 113 33 460 2 522 48 930
avatar 28 046 40 989 48 656 74 442 18 920 31 896 76 669
static_css 37 048 42 843 59 413 72 389 37 095 36 788 75 962
/up 2 571 20 531 29 238 36 557 62 890 4 230 82 265
post_message 166 1 015 2 442 2 935 1 303 556 2 033

Beats Rust in some cases, but with beautiful code and the MVC pattern — see more at the original repository.

Ecosystem

CRails is assembled from standalone shards, each living in its own repo under github.com/OrelSokolov:

Base (resolved by the root shard.yml):

Optional layers (add to your app's shard.yml when needed):

License

MIT

What this is

A full clone of the Ruby on Rails API on Crystal, as 1:1 as possible in the end interface — so that a developer moving from Ruby/Rails feels no difference. Goal: Rails application code ports to Crystal nearly verbatim.

The only namespace difference: CRails instead of Rails.

  • CRails.application, CRails.env, CRails.root, CRails.logger — as Rails.* was in Rails.
  • ERB → ECR (the only visible substitution — the language is different).
  • Commands: crails instead of rails (crails new, crails server, crails generate, crails console, crails routes, crails db:migrate).
Repository

crails

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 11
  • about 3 hours ago
  • October 2, 2026
License

MIT License

Links
Synced at

Wed, 04 Nov 2026 10:41:46 GMT

Languages