Skip to content
rwlang-orgPublic

About

A statically compiled language with an asynchronous-first approach, written in a Python-like style.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

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.

Why rw?

  • Async first: spawn / await and Future[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.

Quick Start

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 files

For installation prerequisites and detailed setup, see INSTALL.md.

A web server in rw

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/rw

See docs/web-framework.md for the API.

Documentation

Getting Help

See Issues and the language specs under docs/specs/.

Contributing

Contribution guidelines are tracked in #71. For now, pick any open issue and send a pull request.

About

A statically compiled language with an asynchronous-first approach, written in a Python-like style.

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages