Getting Started
Installation
See the Downloads page for platform-specific installers. The fastest way:
curl -fsSL https://raw.githubusercontent.com/jdalang/jda-lang/main/install.sh | shVerify:
jda versionHello World
Create hello.jda:
fn main() -> i64 {
print("Hello, world!\n")
ret 0
}Compile and run:
jda build hello.jda -o hello
./helloOr compile and run in one step:
jda run hello.jdaCLI Usage
jda build hello.jda # compile (output: hello)
jda build hello.jda -o myapp # compile with explicit output
jda run hello.jda # compile and execute
jda fmt hello.jda # format source code
jda test tests/ # run test suite
jda doc stdlib/ # generate HTML documentation
jda repl # interactive REPL
jda --version # show versionUsing the Standard Library
Jda ships with 114 packages. Use import to include them:
import "vec"
import "sort"
import "json"
import "net/http"Or use the --include flag for backward compatibility:
jda build --include stdlib/vec.jda --include stdlib/sort.jda myapp.jdaInstall packages locally with the package manager:
jda pkg install vec
jda pkg install sort
jda pkg search hash
jda pkg listVariables and Types
let x = 42 // integer (i64)
let name = "hello" // string (&i8)
let flag = true // boolean
let ch = 'A' // char literal (i64 65)
const MAX = 100 // compile-time constant| Type | Description |
|---|---|
i64 | 64-bit signed integer (default) |
i32 | 32-bit signed integer |
i8 | 8-bit signed integer (byte) |
f64 | 64-bit floating point |
&T | Pointer/reference to type T |
bool | Boolean (true / false) |
Build a CLI Tool
Here’s a simple word-count tool:
import "file_io"
import "string"
fn count_words(text: &i8) -> i64 {
let count = 0
let in_word = 0
for i in range(str_len(text)) {
let c = byte_at(text, i)
if c == 32 or c == 10 or c == 9 {
in_word = 0
} else if in_word == 0 {
in_word = 1
count += 1
}
}
ret count
}
fn main() -> i64 {
let content = file_read_all_str("input.txt")
let words = count_words(content)
print("Words: ")
print_i64(words)
print("\n")
ret 0
}Compile:
jda build --include stdlib/file_io.jda --include stdlib/string.jda wc.jda -o wc
./wcNext Steps
- Syntax Reference — Full language syntax
- Structs & OOP — Struct + trait + impl model
- Concurrency — Green threads and channels
- Standard Library — All 114 packages
- Toolchain — Formatter, LSP, testing, fuzzer