AztecInstitute · Xcojo’s own language
AClang — Advanced Connect Language
One readable file for a whole app. AClang mixes the best of HTML, CSS, JavaScript, Rust, PHP, SQL and Python, and connects to Xcojo services with a single keyword.
BeginnerAClang 1: FoundationsLearn Xcojo’s own language: pages, styles, state and events — one file, compiled to HTML, CSS and JavaScript.4.00 XCJVerified certificateIntermediateAClang 2: Full-stack appsData models, queries, server functions and routes — and connecting your app to Xcojo sign-in, maps and payments.6.00 XCJVerified certificateAdvancedAClang 3: Production & securityTypes that prevent bugs, secure-by-default patterns, performance, and shipping your app through the Xcojo Launchpad.8.00 XCJVerified certificate
Playground
Edit the code and press Run (⌘/Ctrl + Enter). The playground runs the browser side of AClang — @state, @page, @style and @client. @data, @server and route run on a server.
See the generated JavaScript
Language reference
Files and blocks
An AClang file (.acl) is a list of blocks. Each starts with @kind and a { … } body.
| Block | Purpose | Compiles to |
|---|---|---|
@page Name(params) | Markup with {expr}, for x in list { }, if cond { } else { }, on:event={fn} | HTML + render code |
@style [Name] | Scoped CSS; $accent, $radius, $text, $surface, $muted tokens | CSS |
@state | name: Type = start — reactive values | JavaScript store |
@client | fn functions that run in the browser | JavaScript |
@data Model | Typed models: Int, Float, Text(n), Bool, Money(XCJ), Time, Ref<Model>, @auto, @now, @index(…) | SQL tables + migrations |
@server | Server functions, @cache(…), @allow(…) | PHP |
route METHOD "/path/{x: Type}" | URLs → Page or Json; private unless @public; CSRF-checked | PHP router |
connect service | xcojo.signin, astromark, pay, verification, ai | Typed API clients |
Types and values
let name: Text = "Selam" // immutable
var total: Money(XCJ) = 0 XCJ // mutable
let tags: List<Text> = ["new", "sale"]
let maybe: Option<Product> = find first Product where id == 7
enum Status { Draft, Paid, Shipped(Time) }
match status {
Draft => "Not paid yet"
Paid => "Packing"
Shipped(t) => "Shipped on " + t.date()
}
Queries
find Product where price < 5 XCJ and stock > 0 order by price limit 20
find first User where email == input
insert Order { product: p, buyer: me }
update Product where id == p.id set stock = stock - 1
delete Session where created < now() - 30 days
transaction { … }
Errors
fn charge(o: Order) -> Result<Receipt, Text> {
let r = pay.charge(me, o.total, "Order " + o.id)? // ? passes failures up
return ok(r)
}
Security defaults
- Everything in
{ }is escaped; raw HTML needs{raw …}. - Queries always use parameters.
- POST routes check a CSRF token; routes are private unless
@public. Passwordvalues are hashed and can never be printed or logged.- Secrets come from
env.only.
AClang is taught at AztecInstitute. The playground compiles the browser side so you can learn by doing; the server toolchain is introduced in AClang 2.