Getting Started with Jarlang
Welcome!
Jarlang is a warrior-themed, beginner-friendly language for learning programming and experimenting with new ideas. Its syntax is playful, but its features are powerful—perfect for both new coders and creative tinkerers.
đź’¬ Questions or suggestions?
Share your feedback or report issues →
Share your feedback or report issues →
Why Jarlang?
- Simple, readable syntax with themed keywords.
- Easy to declare variables, write functions, and control flow.
- Comes with a rich standard library and test helpers.
- Great for learning, teaching, and rapid prototyping.
1. Running Jarlang
To run a .vase file, use the provided runner script:
./run.sh
Then use the !run command in the REPL:
!run yourfile.vase
2. Language Concepts Tutorial
Variables
Declare with wield:
wield x 10 wield name "JarKnight"
Types: Ints, Doubles, Strings
wield a 42 # int wield b 3.14 # double wield s "hello" # string
Conditionals
wield n 5 judge n > 0 mend chant "positive" orjudge n == 0 mend chant "zero" orjudge mend chant "negative"
Functions & Function Defining
forge add(a, b) {
mend a + b
}
chant add(2, 3) # prints 5
Loops
While loop: lest
wield i 0
lest i < 3 {
chant i
i = i + 1
}
For loop: endure
endure wield j 0; j < 3; j = j + 1 {
chant j
}
Strings & Operations
wield greeting "Hello, " + name chant greeting
Importing & Using the Standard Library
summon "stdlib.vase" chant commune(3, 4) # prints 7.0
3. Standard Library Highlights
Jarlang's standard library includes many helpers for math, strings, and more. Here are some favorites:
max(a, b)— Get the maximum of two numbers.chant max(7, 3) # prints 7
clamp(x, lo, hi)— Restrict a value to a range.chant clamp(15, 0, 10) # prints 10
fact(n)— Compute factorial.chant fact(5) # prints 120
fib(n)— Get the nth Fibonacci number.chant fib(7) # prints 13
concat(a, b)— Concatenate strings.chant concat("Jar", "Knight") # prints JarKnightis_prime(n)— Test for primality.chant is_prime(13) # prints 1
See the full list for more!
4. Tips & Best Practices
- Use
chantto print values and debug your code. - Write small functions with
forgeandmend. - Import
stdlib.vasefor extra helpers. - Use
testlib.vasefor writing and running tests. - Read the Syntax Reference for more details.
Ready to experiment?
Jarlang is designed for learning and creativity. Try changing values, writing your own functions, and exploring the standard and test libraries. The best way to learn is by doing—so start forging your own Jarlang scripts!
Need help? Explore the docs or ask for examples!
Jarlang is designed for learning and creativity. Try changing values, writing your own functions, and exploring the standard and test libraries. The best way to learn is by doing—so start forging your own Jarlang scripts!
Need help? Explore the docs or ask for examples!