Rat Programming Language
Build full-stack web apps in one language. Frontend, backend, and database all live in Rat. Ship a single binary with no runtime to install.
- Websites
- APIs
- Desktop apps
- Mobile apps
Create your first app
curl -fsSL https://rat-lang.com/install.sh | sh
rat new my-app
cd my-app
rat start
[rat] compiled 14 files in 1.8ms
[rat] ready at http://127.0.0.1:8000 (mode: dev, hot-reload: on)
powershell -c "irm https://rat-lang.com/install.ps1 | iex"
rat new my-app
cd my-app
rat start
[rat] compiled 14 files in 1.8ms
[rat] ready at http://127.0.0.1:8000 (mode: dev, hot-reload: on)
RAT Request Flow
Dynamic Styling in RAT
> []
brown_rat: { }
black_rat: { }
gap: 1rem
> [.card]
color: [black_rat]
padding: [gap] [gap * 2]
border-left: 3px solid [brown_rat]
> [.card:hover]
border-color: [brown_rat]
> [@media (max-width: 600px)]
[.card]
padding: [gap * 0.5] Call any function from any language
Import any javascript library
Default Secure Page Manifests
- Signed call manifest Each page ships the exact set of functions it may call. Anything else is refused.
- Path bound A call only runs on the page that declared it.
- Session bound Calls are tied to the caller's session.
- Secure headers Every response carries a CSP nonce and the standard security headers.
Additional Support
- Reusable components Build a pup once and drop it in as a tag anywhere.
- Database modelling Declare models in Rat and get SQLite tables and queries.
- Realtime channels Broadcast live updates to every open page over SSE.
- Function API Expose any function as a JSON endpoint.
- Mobile and desktop Ship the same app to the web, desktop, and Android.
- Static builds Compile a whole project to plain static HTML.
- Binary deployment Deploy one self-contained binary with no runtime to install.
- Monolithic builtins Strings, math, dates, JSON, and more all ship in the binary.
Hot Reload
- Web
- Mobile
- Desktop
| pages | hot reload | cold load | full build |
|---|---|---|---|
| 10 | 0.5 ms | 2.0 ms | 8.7 ms |
| 100 | 2.6 ms | 9.4 ms | 75 ms |
| 1000 | 61 ms | 195 ms | 1.3 s |