Welcome to Prizm! This guide will get you up and running in less than 2 minutes.
#!/bin/bash
curl -fsSL https://raw.githubusercontent.com/Seigh-sword/Prizm/main/install.sh | bash
source ~/.bashrc # Reload your shell
curl -fsSL https://raw.githubusercontent.com/Seigh-sword/Prizm/main/install.sh | bash
source ~/.zshrc # Or ~/.bashrc if using bash
irm https://raw.githubusercontent.com/Seigh-sword/Prizm/main/install.bat | iex
prizm --version
# Should output: Prizm v0.1.0
# Download and run project initializer
curl -fsSL https://raw.githubusercontent.com/Seigh-sword/Prizm/main/init.sh | bash myapp
cd myapp
REM Use the batch initializer
init.bat myapp
cd myapp
Edit src/center.pzm:
output("Hello, Prizm World!"),
var name: string = "Developer",
output("Welcome, " + name),
var result: int = math.add(5, 3),
output("5 + 3 = " + result),
prizm run
Expected Output:
Hello, Prizm World!
Welcome, Developer
5 + 3 = 8
# Run your program
prizm run
# Format your code
prizm pretty src/center.pzm
# Check for errors
prizm lint src/center.pzm
# Get help
prizm --help
Your new project looks like this:
myapp/
├── src/
│ └── center.pzm ← Your main program
├── libs/ ← Custom libraries go here
├── assets/ ← Images, files, etc.
├── project.prizm ← Project configuration
└── README.md ← Project documentation
var age: int = 25,
var height: float = 5.9,
var name: string = "Alice",
var active: boolean = true,
var numbers: array = [1, 2, 3],
var a: int = 10,
var b: int = 5,
output(math.add(a, b)), # 15
output(math.subtract(a, b)), # 5
output(math.multiply(a, b)), # 50
output(math.divide(a, b)), # 2
output(math.random(1-100)), # Random 1-100
var score: int = 85,
if (score >= 90) {
output("A - Excellent!"),
} else if (score >= 80) {
output("B - Good!"),
} else {
output("Keep trying!"),
}
# Loop 5 times
loop 5 {
output("Hello!"),
}
# Loop until condition
loop until (count == 10) {
count = count + 1,
}
define greet(name) {
output("Hello, " + name),
}
greet("World"),
# Create file
file.create("myfile.txt"),
# Modify file
file.modify("myfile.txt", "Hello, World"),
# Read file
var content = file.access("myfile.txt"),
output(content),
# GET request
var response = http.get("https://api.example.com/data"),
output(response),
# POST request
var data: object = {user: "alice", age: 30},
http.post("https://api.example.com/users", data),
var config: object = {
theme: "dark",
autoSave: true,
version: "1.0.0",
},
# Convert to JSON string
var json = data.stringify(config),
# Parse JSON string
var parsed = data.parse(json),
# Validate
var valid = data.validate(config),
# Create window
ui.window("My App", 800, 600),
# Add elements
ui.label("Welcome!", 50, 50),
ui.button("Click Me", 100, 100, 100, 40),
ui.input("Enter text...", 100, 160, 200, 30),
# Render
ui.render(),
# Get current time
var now = time.now(),
output(now),
# Sleep for 2 seconds
time.sleep(2000),
# Get Unix timestamp
var ts = time.timestamp(),
output(ts),
Prizm has 10 built-in headers for different tasks:
| Header | Purpose | Example |
|---|---|---|
file |
File operations | file.create("data.txt") |
math |
Math operations | math.add(5, 3) |
control |
If/else, loops | if (x > 5) { ... } |
var |
Variables | var name: string = "Alice" |
function |
Define functions | define foo() { ... } |
http |
Web requests | http.get("https://...") |
ui |
GUI windows | ui.window("App", 800, 600) |
root |
System access | root.exec("command") |
data |
JSON operations | data.stringify(obj) |
time |
Date/time | time.now() |
source ~/.bashrc (or ~/.zshrc)prizm lint src/center.pzm,).pzmsource/example.pzmHappy Coding! Welcome to the Prizm community.