Skip to content

Language Syntax

SharkBlocks00 edited this page Jul 13, 2025 · 4 revisions

Mrya Language Syntax

This page documents the syntax of the Mrya programming language as it stands.


Variable Declerations

Variables are declared using the let keyword.

Syntax

let variableName = value
  • variableName should be a valid identifier.
  • value can be a string (in quotes) or a number.

Example

let greeting = "Hello, Mrya!"
let age = 25

Output Command

Mrya outputs text or variable values using the output() command.

Syntax

output(expression)
  • expression can be a string literal, a variable or a concatenated string.

Example

output("Welcome to Mrya")
output(greeting)

Functions

Functions are declared using func functionname = define()

Syntax

func greet = define(who) {
    output("Hello " + who)
}
  • Functions do return values using return inside the function, therefore you can do let member = greet("Member"), functions also support variables in the define() section and will become more useful after if statements and user input are added.

Example

func giveNumber = define(num) {
    return num
}

let myVar = giveNumber(42)
output(myVar)

Inputs

Inputs are declared using request()

Syntax

let variable = request("expression")
  • expression can be a variable previously declared.
  • You can also use request() inside an output().

Example

let color = request("What's your favorite color? ")
let food = request("Favorite food? ")
output("You like " + color + " and eat " + food + ".")

If you have any further questions or suggestions, please open an issue!

Clone this wiki locally