SpudLang v0.3

every program ends with run spud

made by DS & Jay
main.spud saved βœ“ Β· Ln 1, Col 1
terminal idle

πŸ₯” How SpudLang Works

A tiny language with sharp edges. Read once, never peel wrong again.

Running a program

SpudLang reads top-to-bottom. Nothing executes until it hits run spud β€” that's the ignition. It must be the very last line of the file.

mash "Hello, potato!"
run spud

Variables

Plant with spud. Reassign with just the name β€” but only if it already exists.

spud age = 25
age = 26          # ok, age exists
score = 10         # ERROR: never planted

Blocks { } have their own scope. Variables don't leak out.

Input & output

mash prints. ask "prompt" waits for the user to type β€” always returns text, even if they typed a number.

spud name = ask "What's your name? "
mash "Hello, " + name

spud n = num(ask "Age? ")   # convert to number

Conditionals

ish age >= 18 {
    mash "Can vote."
} nope ish age >= 13 {
    mash "Teenager."
} nope {
    mash "Kid."
}

Loops

loop i from 1 to 10 {
    ish i % 2 == 0 { sprout }
    mash i
}

Recipes (functions)

recipe add(a, b) {
    serve a + b
}

mash add(2, 3)   # 5

Recipes without serve return nada.

Values

Only nah, nada, 0, and "" are false. Everything else is true.

The rules of the potato

  1. Every program ends with run spud.
  2. Variables must be planted with spud before use.
  3. Blocks { } have their own scope.
  4. + works on two numbers OR two texts. Mixing is an error β€” use str() or num().
  5. peel / sprout only inside loops.
  6. Numbers and text are never equal. 1 == "1" is false.

Built-in spuds

SpudLang v0.3 Β· lovingly mashed by DS & Jay πŸ₯”