This is the main source code repository for rw — a statically typed, async-first compiled language with a Python-flavored surface syntax. It contains the compiler, the C runtime, and the language specs.
- Async first:
spawn/awaitandFuture[T]are first-class. The fiber runtime handles 100k+ tasks on a single thread. - Familiar syntax: Indentation,
def,elif,and/or/not,true/false. - Static types: All parameters, returns, and locals are annotated.
- LLVM backend: Native binaries on macOS arm64 and Linux x86_64.
uv sync --extra dev
make -C runtime
uv run rwc run examples/hello.rw
uv run rwc check examples/hello.rw # type-check only, no codegen
uv run rwc test tests/ # run test_* functions in test_*.rw filesFor installation prerequisites and detailed setup, see INSTALL.md.
examples/web.rw is a small web framework written in rw, with routing, path
parameters, and an HTTP/1.1 server that handles each connection in its own
fiber:
import web
from web import App, Request, Response, text, param
def hello(req: Request) -> Response:
return text(200, "hello, " + param(req, "name") + "\n")
def main() -> int:
app: App = web.new_app()
web.get(app, "/hello/:name", hello)
return web.serve(app, 8080)
uv run rwc run examples/web_app.rw # curl -i http://127.0.0.1:8080/hello/rwSee docs/web-framework.md for the API.
- Language reference: syntax, types, statements, concurrency, every builtin
- Runtime design: value layout, fibers and the scheduler, I/O, GC, rules for extending the runtime
- Standard library:
bufio,fs,json,log,path,process,template,url - Web framework
- Japanese versions: docs/ja/
- Design notes for each feature: docs/specs/
See Issues and the language specs
under docs/specs/.
Contribution guidelines are tracked in #71. For now, pick any open issue and send a pull request.
