Learn RC

Install · Run · Understand. From zero to a working server in 10 minutes.

← Back to homepage

1. Install RC

curl -fsSL https://rc.ami.best/install.sh | sh

Verify:

gma version
# gma (RC) 0.1.0

2. Your first RC program

Create app.rc:

<rc>
<ropecode>
<gma>
    <server port="8080">
        <route path="/" method="GET">
            return "Hello, World"
        </route>
    </server>
</gma>
</ropecode>
</rc>

Run it:

gma check app.rc       # syntax check
gma run:8080 app.rc    # start server

Open http://localhost:8080 → you'll see "Hello, World"

3. Add routes and JSON

<server port="8080">
    <route path="/api/user" method="GET">
        <var name = request.query.get("name", "Guest") />
        return json({name: name, greeting: "Hi " + name})
    </route>
</server>

4. Call another API

<route path="/github" method="GET">
    <var resp = http.get("https://api.github.com/users/torvalds") />
    return json({login: resp.json.login, repos: resp.json.public_repos})
</route>

5. User memory

<mem name="buf" size="1024" />
<mem name="buf" at="0" value="72" />
<var b0 = buf.get(0) />
return json({byte0: b0, size: buf.len()})

6. Compile to native

gma build:native app.rc
./app   # single ELF binary, no runtime

Learn in your language

RC supports keywords in 12 languages:

English தமிழ் हिन्दी മലയാളം తెలుగు ಕನ್ನಡ 한국어 中文 日本語 Español Français Deutsch
gma-learn           # English tutorial
gma-learn ta        # Tamil
gma-learn hi        # Hindi
gma-learn list      # all languages

What's next