Skip to main content

RAGL — a memory-safe, flexible-syntax, AI-native programming language

Project description

RAGL

RAGL

Ragulraj's Advanced General Language
One language. Every domain.

language 1.0 · compiler 0.1.0 · runtime 0.1.0 · IR 1
Created by Ragulraj Dhamodharan · Shivoraa


RAGL is a memory-safe, dynamically typed, flexible-syntax language with a batteries-included standard library and a first-class AI engine.

Flexible syntax means many surface forms, one canonical meaning — every dialect is a deterministic rewrite to the same AST. RAGL has a formal grammar, a static checker, structured diagnostics and a conformance suite, and ragl explain will show you exactly what your program became.

create variable name with value "Ragulraj"     # all six of these
set name to "Ragulraj"                         # produce exactly
let name be "Ragulraj"                         # the same node:
name is "Ragulraj"                             #
name → "Ragulraj"                              #   Assign(name, 'Ragulraj')
name = "Ragulraj"                              #

Install

pip install ragl-lang            # the CLI is `ragl`

Note on the name: pip install ragl installs an unrelated retrieval-augmented-generation library that already owns that name on PyPI. The distribution here is ragl-lang; the import name and command are both ragl.

Optional extras:

pip install "ragl-lang[ai]"      # real model access for the `ai` phrases
pip install "ragl-lang[crypto]"  # AES-256-GCM and bcrypt (both have fallbacks)
pip install "ragl-lang[all]"

From source:

git clone https://github.com/ragulraj/ragl && cd ragl
pip install -e .
python -m unittest discover -s tests

Requires Python 3.9+. No mandatory dependencies.

Hello, RAGL

echo 'say "Hello World"' > hello.ragl
ragl run hello.ragl
Hello World

The command line

Command What it does
ragl run app.ragl check, then run
ragl check app.ragl diagnostics without running
ragl explain app.ragl print the canonical IR
ragl repl interactive session
ragl modules built-in modules and their capabilities
ragl install ./lib · ragl list · ragl uninstall lib packages
ragl editor install syntax highlighting + icons into VS Code / Cursor / VSCodium
ragl version all four version surfaces

Capabilities are granted, not assumed:

ragl run app.ragl --allow files            # files only
ragl run app.ragl --allow files,network
ragl run app.ragl --allow ""               # pure computation

Editor support

The VS Code extension ships inside the package, so it stays in step with the version you installed — no marketplace round trip:

pip install ragl-lang
ragl editor                 # detects VS Code, Cursor, VSCodium, Windsurf

Reload your editor and you get syntax highlighting (including {interpolation}), # comment toggling, auto-indent after if/define/class with outdent on end, and the RAGL icon on the editor tab. For the icon in the file explorer, run Preferences: File Icon ThemeRAGL.

ragl editor uninstall removes it; ragl editor path prints where the extension lives.

A tour

# Conditions in three dialects, one meaning
if age is greater than 18
    say "Adult"
otherwise
    say "Minor"
end

say "Adult" if age > 18

# Loops with skip / stop / retry
for each item at index in ["red", "green", "blue"]
    skip if item is "green"
    say "{index}: {item}"
end

# Functions, defaults, lambdas, closures
define greet with who, greeting = "Hello"
    return "{greeting}, {who}!"
end
double = value → value * 2

# The full object model
interface Shape
    needs area
end

abstract class Figure implements Shape
    has name
    has private id
    shared created = 0
    define area
        return 0
    end
end

class Circle extends Figure
    has radius
    create with radius
        super create with "Circle"
        self.radius = radius
    end
    define area
        return PI * self.radius * self.radius
    end
    define text
        return "Circle(r={self.radius})"
    end
end

c = new Circle(2)
say c.area                # 12.56636 — a zero-parameter method reads as a property
say c is a Shape          # true
say c                     # Circle(r=2)

# Files
write to file "notes.txt" with "Hello RAGL"
say read file "notes.txt"

# A real database
connect to database "app.db"
create table Users with
    id auto increment primary
    name text required
    email text unique required
end
insert into Users
    name = "Ragulraj"
    email = "rag@shivoraa.in"
end
say get from Users where name == "Ragulraj"

# Security, with the construction documented
hashed = hash "myPassword" using bcrypt
say check if "myPassword" matches hashed

# AI — offline by default, so this runs with no key
say ai analyze "I love this product" for sentiment     # positive

# An HTTP API
start server on port 8080
route GET "/"
    send "Welcome to the RAGL API"
end

# Concurrency
run together
    a = secure get "https://example.com/one"
    b = secure get "https://example.com/two"
end

Every snippet above is exercised by examples/ and tests/.

Examples

ragl run examples/01-hello.ragl          # the six dialects
ragl run examples/02-basics.ragl         # types, conditions, loops, functions
ragl run examples/03-collections.ragl    # lists, dicts, sets, stacks, queues
ragl run examples/04-objects.ragl        # the full object model
ragl run examples/05-errors.ragl         # structured errors
ragl run examples/06-files.ragl          # file handling
ragl run examples/07-database.ragl       # SQLite
ragl run examples/08-security.ragl       # hashing, encryption, JWT
ragl run examples/09-ai.ragl             # the AI engine
ragl run examples/10-web.ragl            # page → HTML
ragl run examples/11-server.ragl         # HTTP API (Ctrl-C to stop)
ragl run examples/12-concurrency.ragl    # parallel, background, timers

How it works

source ─▶ lexer ─▶ intent resolver ─▶ parser ─▶ canonical AST ─▶ checker ─▶ interpreter
                   (deterministic,                    │
                    no model call)                    └─ `ragl explain` prints this

The canonical AST is the contract between the front end and the runtime. A bytecode VM can replace the interpreter without changing what any program means.

Documentation

Document Covers
01 — Language Specification the normative language reference
02 — Compiler lexer, intent resolver, parser, IR, checker
03 — Runtime execution, memory, concurrency, security, objects
04 — Standard Library every module and phrase
05 — Package Manager packages, resolution, versioning
06 — AI Engine providers, agents, non-goals
07 — Errors the full diagnostic catalogue
08 — Grammar formal EBNF
09 — Scope what RAGL is, and what it deliberately is not
10 — Roadmap versioning, plan, governance

What RAGL does not do

RAGL states its boundary rather than implying there isn't one. It has no raw pointers, no manual memory management, no templates, and no multiple implementation inheritance — those contradict its memory-safety guarantee or its dynamic type system. Generators, operator overloading and a bytecode VM are planned, not present. Benchmarks will be published only once the VM exists. Details: docs/09-scope.md.

Publishing (maintainer)

python -m build                  # → dist/ragl_lang-0.1.0-py3-none-any.whl + .tar.gz
python -m twine upload dist/*    # needs your PyPI credentials

License

MIT © 2026 Ragulraj Dhamodharan

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragl_lang-0.1.1.tar.gz (143.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragl_lang-0.1.1-py3-none-any.whl (116.1 kB view details)

Uploaded Python 3

File details

Details for the file ragl_lang-0.1.1.tar.gz.

File metadata

  • Download URL: ragl_lang-0.1.1.tar.gz
  • Upload date:
  • Size: 143.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for ragl_lang-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dfa24a5c82aaed5ac54e17e7d961c07eeb9642dfb4a70ffb5e65834f0aaebcf5
MD5 8eb6c03cac9ced323cc580ed2d36e454
BLAKE2b-256 64a73c5174651371b67c31175a17c580dc0c65a578efd1c9bd926239438c285d

See more details on using hashes here.

File details

Details for the file ragl_lang-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ragl_lang-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 116.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for ragl_lang-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 271dbe679487ef7b31dcdf1afb08cf351fd4c06cdd8c3dabe9382e038586489c
MD5 a0d925b8bb4c84bc468f3db852d8ed61
BLAKE2b-256 a8aea40b343f89289b61336a62945fb7db3e12f053e1b2f6a36566de3b53afa4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page