Skip to content

Standard Library

Run ships with a comprehensive standard library, comparable in scope to Go’s. It covers the most common tasks so you can build real applications without third-party dependencies.

PackageDescription
fmtString formatting and printing
stringsString searching, splitting, joining
bytesByte slice utilities
mathMathematical functions and constants
timeTime, durations, and timers
PackageDescription
ioReaders, writers, buffered I/O
osFile system, processes, environment
logStructured logging
PackageDescription
netTCP/UDP sockets, DNS resolution
httpHTTP server and client
PackageDescription
jsonJSON encoding and decoding
cryptoHashing, encryption, TLS
PackageDescription
syncMutexes, atomics, wait groups
testingBuilt-in test framework
package main
use "http"
use "fmt"
fun handle(w: &http.ResponseWriter, r: @http.Request) {
w.write("Hello from Run!")
}
pub fun main() {
http.handlefn("/", handle)
fmt.println("listening on :8080")
http.listenAndServe(":8080")
}

The standard library is designed to be practical and unsurprising. When you need something common — reading a file, serving HTTP, encoding JSON — it is already there.