The programming language with attitude.
spin (vibe x = 10; x >= 0; x -= 1) {
yap("nonsense")
}
npm install -g slaylang
slay setup
Linux (Arch/Manjaro/etc.)
mkdir -p ~ /.npm-global
npm config set prefix ~ /.npm-global
export PATH=" $HOME /.npm-global/bin:$PATH "
fish_add_path ~/.npm-global/bin
Exception: buddy, variable x does NOT exist
vibe x = 10 # mutable variable
lockedin y = 42 # constant, don't even try to reassign it
vibe name = "slay"
vibe nothing = ghosted # null
SlayLang
Meaning
vibe
mutable variable (let)
lockedin
constant (const)
ghosted
null / None
vibe isReal = nocap # true
vibe isCap = cap # false
SlayLang
Meaning
nocap
true
cap
false
yap("hello world") # prints: hello world
yap(nocap) # prints: nocap
yap(ghosted) # prints: ghosted
rant("hello world") # prints: hello world !!
SlayLang
Meaning
yap(...)
print normally
rant(...)
print with !! at the end
vibe name = snoop("what's your name? ")
vibe age = intify(snoop("how old are you? "))
vibe price = floatify(snoop("enter price: "))
SlayLang
Meaning
snoop(prompt)
read input from stdin
intify(value)
convert to integer
floatify(value)
convert to float
vibe a = 2 ** 8 # power → 256
vibe b = 10 % 3 # modulo → 1
vibe c = 17 \ 5 # floor divide → 3
vibe d = a + b # → 257
SlayLang
Meaning
+ - * /
standard arithmetic
**
power / exponent
%
modulo
\
floor divide
== != > < >= <=
comparison
&&
logical and
||
logical or
nah
logical not
vibe x = 10
x += 5 # x is now 15
x -= 3 # x is now 12
x *= 2 # x is now 24
x /= 4 # x is now 6
sus (x > 10) {
yap("big number")
} mid (x == 10) {
yap("exactly ten")
} tho {
yap("small number")
}
SlayLang
Meaning
sus
if
mid
else if
tho
else
# while loop
grind (x > 0) {
yap(x)
x -= 1
}
# for loop
spin (vibe i = 0; i <= 10; i += 1) {
sus (i == 5) { skip } # continue
sus (i == 8) { dip } # break
yap(i)
}
SlayLang
Meaning
grind
while loop
spin
for loop
dip
break
skip
continue
cook greet(name) {
yeet name
}
yap(greet("world"))
cook factorial(n) {
sus (n <= 1) {
yeet 1
}
yeet n * factorial(n - 1)
}
yap(factorial(10))
SlayLang
Meaning
cook
define a function
yeet
return a value
vibe nums[] = [1, 2, 3, 4, 5]
yap(nums[0]) # 1
nums[0] = 99 # mutation
yap(nums[0]) # 99
# nested arrays
vibe matrix[] = [[1, 2], [3, 4]]
yap(matrix[0][1]) # 2
matrix[1][0] = 99
vibe arr[] = []
push(arr, 10) # append
push(arr, 20)
pop(arr) # remove last
yap(len(arr)) # 1
SlayLang
Meaning
push(arr, val)
append to array
pop(arr)
remove last element
len(arr)
length of array
cook fizzbuzz(n) {
spin (vibe i = 1; i <= n; i += 1) {
sus (i % 15 == 0) {
yap("FizzBuzz")
} mid (i % 3 == 0) {
yap("Fizz")
} mid (i % 5 == 0) {
yap("Buzz")
} tho {
yap(i)
}
}
}
fizzbuzz(20)
slay setup grabs the VS Code extension automatically. No marketplace digging.
Bug, infinite loop, fan taking off. Open an issue or send a PR. Real parser/lexer/evaluator, not a toy. Read the code first.
MIT. Use it, fork it, break it. Just credit it.
Built by Faizeen Hoque .