QuickScript Documentation
Welcome to QuickScript, a blazingly fast, async-first programming language designed for modern computing. This documentation will guide you through everything you need to know to get started.
What is QuickScript?
QuickScript is a statically-typed, compiled programming language that leverages LLVM to generate highly optimized machine code. It's designed for developers who need both rapid development cycles and production-grade performance.
Key Features
Blazingly Fast: Compiles to native code
via LLVM, achieving C-level performance.
Async First: Built-in async/await with
lightweight runtime for handling concurrent
operations.
JIT & AOT: Choose between Just-In-Time
compilation for development or Ahead-Of-Time for
production.
Type Safe: Strong static typing with
inference catches errors at compile time.
Installation
Get QuickScript up and running on your system in minutes.
macOS & Linux
Install QuickScript using the official installer script:
curl -fsSL https://quick-script.dev/install.sh | sh
Windows
Download the Windows installer from the releases page or use PowerShell:
irm https://quick-script.dev/install.ps1 | iex
Verify Installation
quick --version
Hello World
Write and run your first QuickScript program.
Create Your First Program
Create a new file called hello.qx:
print("Hello, World!")
Run It
quick run hello.qx
Variables
Learn how to declare and use variables in QuickScript.
Declaration
Use the let keyword to declare variables:
let name = "QuickScript";
let version = 1.0;
let isAwesome = true;
Type Annotations
You can optionally specify types explicitly:
let count: Num = 42;
let message: Str = "Hello";
let active: Bool = true;
Functions
Define reusable blocks of code with functions.
Basic Functions
fun greet(name: Str) {
print("Hello, " + name + "!");
}
greet("World");
Return Values
fun add(a: Num, b: Num) {
return a + b;
}
let result = add(5, 3);
print(result); // Outputs: 8
Anonymous Functions
let double = fun(x: Num) {
return x * 2;
};
print(double(21)); // Outputs: 42
Types
QuickScript's type system keeps your code safe and fast.
Primitive Types
Num - Numbers (integers and floats)
Str - Strings
Bool - Booleans (true/false)
Type Inference
QuickScript automatically infers types when possible:
let x = 42; // Inferred as Num
let y = "hello"; // Inferred as Str
let z = true; // Inferred as Bool
Control Flow
Control the execution flow of your programs.
If Statements
let age = 18;
if age >= 18 {
print("Adult");
} else {
print("Minor");
}
For Loops
for i in io.range().to(10) {
print(i.str());
}
IO Module
Handle input/output operations with the IO module.
Console Output
print("Hello, World!");
let answer = 42;
print("The answer is: " + answer.str());
Ranges
for i in io.range().from(1).to(5) {
print(i.str());
}
// Outputs: 1, 2, 3, 4
Network Listeners
io.listen(8080, fun(req: Request) {
return web.text("Hello!");
});
Web Module
Build web servers and APIs with ease.
Creating a Web Server
let web = io.web();
io.listen(8080, fun(req: Request) {
return web.file("./public" + req.path);
})
Text Responses
let web = io.web();
io.listen(8087, fun(req: Request) {
return web.text("Ok!");
})
Collections
Work with arrays and other collection types.
Arrays
let numbers = [1, 2, 3, 4, 5];
let names = ["Alice", "Bob", "Charlie"];
Iteration
let items = [10, 20, 30];
for i in io.range().to(items.len()){
print(items[i].str());
}
CLI Commands
Master the QuickScript command-line interface.
Running Programs
quick run script.qx # Run with JIT
quick build script.qx # Compile to binary
Project Management
quick format # Format code
JIT vs AOT
Choose the right compilation strategy for your use case.
JIT (Just-In-Time)
Best for development and scripting. Fast startup, immediate execution.
quick run script.qx
AOT (Ahead-Of-Time)
Best for production. Maximum performance, standalone binaries.
quick build script.qx
./bulid/program
Debugging
Tools and techniques for debugging QuickScript programs.
Debug Mode
Run with debug symbols for better error messages:
quick run --debug script.qx
Print Debugging
let value = computeSomething();
print("DEBUG: value = " + value.str());
// Continue with program...