syntax

A syntax reference for Sounio, a programming language that resembles Rust but uses different rules.

In plain words
What is it for?
Use it while writing or reviewing .sio files to check valid bindings, references, functions, collections, arithmetic, and other Sounio syntax.
Why use it?
It prevents common Rust-based mistakes, such as semicolons, mutable-binding syntax, mutable-reference syntax, macros, closures, unary negative literals, and incorrect shift types.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sounio-lang/sounio/syntax
Clone the repo
git clone --depth 1 https://github.com/Sounio-lang/sounio

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 872 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00872
Opus 5 $0.00000 $0.00436
Sonnet 5 $0.00000 $0.00174
Haiku 4.5 $0.00000 $0.00087

Measured 2d ago against content hash f5a831d411cd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

syntax scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/syntax.mdc · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sounio Syntax — Anti-Rust Patterns

Sounio LOOKS like Rust but has different syntax and semantics. These are the most common mistakes.

1. NO Semicolons

Sounio statements end WITHOUT semicolons. The parser treats ; as an error.

// WRONG
let x = 5;
// CORRECT
let x = 5

2. var not let mut

Mutable bindings use var. There is no let mut.

// WRONG
let mut x = 10;
// CORRECT
var x = 10

3. &! not &mut

Exclusive (mutable) references use &!T. There is no &mut.

// WRONG
fn set(x: &mut i32) { *x = 5 }
// CORRECT
fn set(x: &!i32) with Mut { *x = 5 }

4. NO Macros

Sounio has no macro system. No ! after function names.

// WRONG
assert!(x > 0)
println!("hello")
vec![1, 2, 3]
// CORRECT
assert(x > 0)
println("hello")
[1, 2, 3]

5. NO Closure Literals

|x| x + 1 does not compile. Use named function references.

// WRONG
let f = |x| x + 1
// CORRECT
fn add_one(x: i64) -> i64 { x + 1 }
let f = add_one

6. NO Unary Minus

The parser does not support -42 as a literal. Use subtraction from zero.

// WRONG (may parse incorrectly)
let neg = -42
// CORRECT
let neg = 0 - 42

7. Bit Shifts Require u8

Shift operands must be typed as u8.

// WRONG
let shifted = x >> 4
// CORRECT
let shifted = x >> 4u8

8. Array Index Requires Cast

Array indices must be usize.

// WRONG
let val = arr[i]
// CORRECT
let val = arr[i as usize]

9. NO Attributes

No #[test], #[derive()], or any other attributes.

10. NO .len() / .push() on Arrays

Fixed arrays are not objects. Track length manually or use stdlib IntVec.

struct IntVec { data: [i64; 4096], len: i64 }
impl IntVec {
    fn push(self: &!IntVec, val: i64) with Mut, Panic {
        self.data[self.len as usize] = val
        self.len = self.len + 1
    }
}

11. Effects Are MANDATORY

Functions with side effects MUST declare them. See .cursor/rules/effects.mdc.

12. Match Arms — NO Commas

match value {
    Pattern1 => result1
    Pattern2 => result2
    _ => default
}

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 129 lines · 0 tokens per session scan A f5a831d411cd

Subscribe to this mod's changes

syntax is a cursor rule published in the GitHub repository Sounio-lang/sounio (5 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 872 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.