Xag

Under development, don't treat this website's info as truth.

Somewhere to find out how the syntax feels, without cloning anything or building LLVM.

Try it

The editor is here once the page has loaded. It runs on a small interpreter in your browser, not on the compiler.

What this is not

This is not the compiler. It is a few hundred lines written for this website, and where it disagrees with xagc, it is wrong and xagc is right.

It exists because trying a syntax and trusting a language are different questions, and the first should not cost a checkout and a build of LLVM. It answers the first one only.

What it knows:

  • var and var.mut inside START, and const above it, of type int64
  • set, on a name whose chain said mut
  • arithmetic: +, -, x, / and mod, with mathematics' own precedence
  • print.stdout, with str: text, names, sums and \n
  • loop.range.int64, over a first and last value
  • one START block, and comments

What it does not:

  • ownership — nothing is moved, borrowed or checked. This is the half of Xag that matters most and the playground has none of it
  • every type but int64: no str variables, no bin, no deci, no bool
  • functions, struct, many, if, when, give, read.stdin
  • the compiler's diagnostics — errors here are this interpreter's own words, and much poorer
  • anything about how fast a real Xag program runs
  • being right. Where it and xagc disagree, xagc is right

Every program it ships with is run through both it and the real compiler, and they agree — that check is src/verify_play.rs and somebody has to run it. It is not protection against the language moving underneath, which Xag does, weekly. Build the compiler for the language itself.