A specification for the rizz programming language.
sigma x is 100
sigma t
t is based
// boolean
based
cringe
// numeric
100 // Integer
3.14 // Floats
- If statements
- Switch statements
- Loops
- Lists
- Functions
- Sum types
- Product types
- Traits
- Error handling
- Namespaces
- Packages
- Standard library
- Complete example
// Variables and values
sigma x is 100 + 200 - 300 * 400 / 500
sigma y is cringe and based or not cringe
sigma z is "Hello, World!"
// If statement
vibe check x is less than 100 then yap "x < 100"
ratio x is 100 then yap "x == 100"
ratio x is greater than 100 { tap "x > 100" }
ratio then yap "idek"
// Pattern matching
goofy x {
ahh 100 then yap "x == 100"
ahh <100 then yap "x < 100"
ahh >100 then yap "x > 100" fall
ahh -100..0 then fall
ahh { yap "oh no" sigma x is 10 }
}
// Loops
cooking y {
x is x - 1
yap x
vibe check x is 0 then cooked
}
cooking from x to 0 {
sigma i is x's index
yap i
}
// Lists
sigma squad is [based, cringe, based, based]
sigma squad2 is [..squad, based, based]
cooking through squad with item {
yap item
}
// Functions
slay double with sigma a then rizz a * 2
slay string_to_list with sigma s {
sigma l is []
cooking through s with c then append c to l cooked
rizz l
}
/// Main function
main character with sigma argc argv {
then yap z
rizz
}
// Sum types
zesty Game is Win or Loss
sigma g is Win
sigma g is Game Win // the same
// Product types
combo Point is sigma int x int y
sigma p is Point 10 10
// Traits
looksmaxxing Barkable where {
slay bark then yap "Bark"
}
glow up Barkable for Point where {
slay bark then yap "Bark"
}
// Error handling
slay some_func with sigma a {
vibe check a is not 100 then clapback "a is not 100"
ratio then rizz a
}
yap (yeet some_func)
// Namespace
era Code where {
// ...
}
// Packages
grab SomePackage from "../.."
grab IO
grab Maths
grab Random