Syntax

Mid Valyrian Syntax

Write `.mv` files with readable royal commands, then run them from a terminal with midv example.mv.

Program Shape

Entry pointon the iron throne:
Comments// ignored until the end of the line
BlocksIndent statements under a header

Values

blade42
wine3.14
scroll"Fire and Blood"
vowaye / nay
sigil'D'
voidempty return value

Input And Output

Speakspeak expression
Read inputname speaks for input
Declare before inputname is a scroll with ""

Control Flow

Ifif condition:
Elseelse:
Counted loopthe realm marches 5 times:
While loopwhile power < 30:

Functions

Declarewe declare add with x, y ->
Body markercouncil says:
Returnreturn x + y
Calladd with 5, 7

Expressions

Arithmetic+ - * /
Comparison> < == !=
Unary-value !condition
Grouping(x + y)
Complete File

A runnable `.mv` program.

we declare greet with name ->
council says:
    return "Valar Dohaeris, " + name

on the iron throne:
    name is a scroll with ""
    name speaks for input

    the realm marches 2 times:
        speak greet with name