R Rak v1.1.0

v1.1.0 · runs in your browser

A language for hackers
& OSINT

English-readable syntax, first-class hexadecimal, pipelines, regex literals, and a systems stdlib: foreign function calls, zero-copy memory maps, raw sockets, and wire parsers. Write scanners like sentences.

hexhunt — rak
// binary pattern matching over bytes
fn sniff(d: bytes) {
    match d {
        [0x89, 'P', 'N', 'G', ..] => { return "png" },
        [0xFF, 0xD8, 0xFF, ..] => { return "jpeg" },
        _ => { return "unknown" },
    }
}

// zero-copy over a mapped capture
let m = mmap_open("trace.pcap", "r")
let hits = mmap_slice(m, 0x1000, 64)
    |> regex_find_all(/\d+\.\d+\.\d+\.\d+/g)
$ rakc run hexhunt capture.bin findings: 3 0x00000000 PNG image 0x0000000B JPEG image 0x0000000F PDF document
21:045G
$ rakc run scan.rak [SCAN] 10.0.0.0/24 [DUMP] 0x0016 open [DUMP] 0x0050 open [DUMP] 443 open

Features

What is Rak?

One frontend, two backends. Everything below ships in the compiler and works in the IDE.

|>

Pipeline |>

Chain calls left-to-right. data |> parse |> load reads top-to-bottom like a sentence.

/\d+/

Regex literals

Write /\d+/g inline. A / after a value is division; everywhere else it is a regex.

0x89

Binary patterns

Match byte slices by magic number: [0x89, 'P', 'N', 'G', ..]. Built for PCAP and file sniffing.

impl

Traits & protocols

Implement Display, Iterable, Index. They drive dump, for, and obj[key].

C

Systems stdlib

FFI, memory-mapped files, raw sockets, async I/O, DNS/TLS/PCAP parsers, macros, and modules.

~6x

Bytecode VM

The VM runs the same code about six times faster than the tree-walker. Compare with rakc bench.

key

VPN toolkit

X25519 key exchange, ChaCha20-Poly1305 AEAD, HKDF key derivation, tunnel framing, and an encrypted UDP transport.

cite

Evidence provenance

Every decoded value can carry where it came from, and a report can cite it. Chain of custody, in the type system.

IDE

Desktop IDE

A Tauri + Next.js IDE with a real-time explorer, smart completion, an in-editor docs panel, and a GUI designer.

One language, two engines

The backends agree

Rak ships a tree-walking interpreter and a bytecode VM. A gate in the test suite compares their builtin registrations name by name, and the gap is zero: every builtin both engines expose, they expose on both.

run

The interpreter

A tree walker over the AST. It is the reference implementation: contracts, evidence provenance, closures and the GUI all run here first.

vm

The bytecode VM

A stack machine with the same builtin surface. Channels, TCP, WebSocket, DNS and futures are native there too, not a subset.

=

The gate

A structural check reads both registration tables and fails on any name they do not share, plus behavioural tests run the same program on each.

Remaining gaps

Postconditions and closure capture of locals run on both backends now. The ones that remain are written down, not hidden.

Workflow

From nothing to a shipped tool

Install a release or build from source, then stay in one toolchain.

01

Install

A native installer edits your PATH, sets RAK_PATH, and records every action for clean uninstall.

02

Write

One file or a package tree. The IDE, the CLI, and the language server all read the same source.

03

Run

rakc run on the interpreter, rakc vm on the bytecode, rakc build to a native binary.

04

Ship

oyvey vendors dependencies into packages/ and locks every revision with a checksum.

The language

English in, packets out

No ceremony. Read it like a sentence, run it like a scanner.

fn inc(n) { return n + 1 }
fn dbl(n) { return n * 2 }

// pipeline reads left-to-right
dump 5 |> inc |> dbl        // 12

// regex literals match inline
let re = /\d+/g
dump re.find_all("a1 b22 c333")   // [1, 22, 333]
// binary pattern matching over bytes
fn sniff(d: bytes) {
    match d {
        [0x89, 'P', 'N', 'G', ..] => { return "png" },
        [0xFF, 0xD8, 0xFF, ..] => { return "jpeg" },
        _ => { return "unknown" },
    }
}
dump sniff(b"\x89PNG\x0d\x0a\x1a\x0a")  // png
// call C from Rak
extern "C" from "libc.so.6" {
    fn abs(n: i32) -> i32
}
dump abs(-42)                 // 42

let libc = ffi_load("libc.so.6")
dump libc.call("getpid", [])
// async I/O + raw packet forging
let f = tcp_probe(host, 80, 200)
let open = await f

let pkt = net_raw_tcp_syn("10.0.0.5", "10.0.0.10", 12345, 80)
dump len(pkt)   // 40 bytes

dns_query("example.com", "A")

Standard library

Packs that ship with the compiler

No wrappers to write first. The boring parts are already done, and they behave the same on both backends.

net
crypto
json
osint
http
websocket
vpn
secrets
process
files
mmap
streams
sets
escape
datafmt
pcap

Start in 30 seconds

Grab a release, or build from source. Then open the IDE and the tutorial walks you through everything new.