radlang — Built-in hover reference

This page mirrors the signatures supplied by the compiler’s LSP catalog (src/builtin_catalog.rs and src/builtin_methods.rs). Namespace guides contain the longer explanations; this page is the compact signature reference.

Namespaces

fn sys.output(?any value): void
fn sys.output.write(any value): void
fn sys.output.flush(): void
fn sys.output.clear(): void
fn sys.input(?string prompt): string
fn sys.exit(int status): void
fn sys.env(string name, ?string value): string
fn sys.error(?string message): void
fn sys.sleep(int ms): void
fn sys.args(): string[]
fn sys.cwd(): string
fn sys.pid(): int
fn sys.platform(): string
fn sys.arch(): string
fn sys.hostname(): string
fn sys.sleepAsync(int ms): Future<void>
fn sys.cli(string cmd): Future<int>
fn sys.cores(): int
fn sys.spawn(string exe, string[] args): Future<int>
fn sys.home(): string
fn sys.tmp(): string

fn cfg.env(string key): string
string cfg.name; string cfg.version; string cfg.profile
string cfg.buildDir; string cfg.srcDir; string cfg.staticDir
string cfg.libDir; string cfg.testsDir; string cfg.namespaceDir

fn math.random(): num
fn math.seed(int s): void
fn math.sqrt(num x): num
fn math.abs(num x): num
fn math.floor(num x): num
fn math.ceil(num x): num
fn math.round(num x): num
fn math.log(num x): num
fn math.log2(num x): num
fn math.log10(num x): num
fn math.sin(num x): num
fn math.cos(num x): num
fn math.tan(num x): num
fn math.pow(num base, num exp): num
fn math.min(num a, num b): num
fn math.max(num a, num b): num
fn math.clamp(num x, num lo, num hi): num
float math.PI; float math.E; float math.TAU
fn math.sort.radix(numeric[] values[, int threadCount]): numeric[]
fn math.sort.count(numeric[] values): numeric[]
fn math.sort.timsort(numeric[] values): numeric[]
fn math.sort.intro(numeric[] values): numeric[]
fn math.sort.pdq(numeric[] values): numeric[]

fn json.parse<T>(string body): T
fn json.from(any value): string
fn json.get(JsonNode node, string key): JsonNode
fn json.at(JsonNode node, int index): JsonNode
fn json.string(JsonNode node): string
fn json.int(JsonNode node): int
fn json.float(JsonNode node): float
fn json.bool(JsonNode node): bool
fn json.isNull(JsonNode node): bool
fn json.length(JsonNode node): int
fn json.keys(JsonNode node): string[]
fn json.getString(JsonNode node, string key): string
fn json.getInt(JsonNode node, string key): int
fn json.getFloat(JsonNode node, string key): float
fn json.getBool(JsonNode node, string key): bool
fn json.atString(JsonNode node, int index): string
fn json.atInt(JsonNode node, int index): int
fn json.atFloat(JsonNode node, int index): float
fn json.atBool(JsonNode node, int index): bool

fn xml.parse(string body): XmlNode
fn xml.from(any value): XmlNode
fn xml.string(XmlNode node): string
fn xml.tag(XmlNode node): string
fn xml.text(XmlNode node): string
fn xml.attr(XmlNode node, string key): string
fn xml.hasAttr(XmlNode node, string key): bool
fn xml.attrs(XmlNode node): string[]
fn xml.isNull(XmlNode node): bool
fn xml.child(XmlNode node, int index): XmlNode
fn xml.childCount(XmlNode node): int
fn xml.children(XmlNode node): XmlNode[]
fn xml.find(XmlNode node, string tag): XmlNode
fn xml.findAll(XmlNode node, string tag): XmlNode[]

fn regex.from(string pattern, string flags?): RegEx

fn fs.readText(string path): Future<string?>
fn fs.readTextSync(string path): string?
fn fs.readBytes(string path): Future<byte[]>
fn fs.readBytesSync(string path): byte[]
fn fs.stat(string path): FileInfo
fn fs.exists(string path): bool
fn fs.basename(string path): string
fn fs.dirname(string path): string
fn fs.extension(string path): string
fn fs.resolve(string path): string
fn fs.listDir(string path): string[]
fn fs.listDirFull(string path): string[]
fn fs.mkdir(string path): bool
fn fs.delete(string path): Future<bool>
fn fs.deleteSync(string path): bool
fn fs.writeText(string path, string content): Future<bool>
fn fs.writeTextSync(string path, string content): bool
fn fs.writeBytes(string path, byte[] data): Future<bool>
fn fs.writeBytesSync(string path, byte[] data): bool
fn fs.appendText(string path, string content): Future<bool>
fn fs.appendTextSync(string path, string content): bool
fn fs.appendBytes(string path, byte[] data): Future<bool>
fn fs.appendBytesSync(string path, byte[] data): bool
fn fs.rename(string from, string to): Future<bool>
fn fs.renameSync(string from, string to): bool
fn fs.copy(string from, string to): Future<bool>
fn fs.copySync(string from, string to): bool
fn fs.tempFile(): Future<string>
fn fs.tempFileSync(): string
fn fs.tempDir(): Future<string>
fn fs.tempDirSync(): string
fn fs.walk(string path): Future<string[]>
fn fs.walkSync(string path): string[]
fn fs.readDirInfo(string path): Future<DirEntry[]>
fn fs.readDirInfoSync(string path): DirEntry[]
fn fs.watch(string path, fn(string): void callback): void
fn fs.join(string a, string b): string

fn hash.md5(string input): string
fn hash.sha1(string input): string
fn hash.sha256(string input): string
fn hash.sha512(string input): string
fn crypto.hmacSha256(string key, string input): string
fn crypto.base64Encode(string input): string
fn crypto.base64Decode(string input): string
fn crypto.randomBytes(int n): string
fn crypto.aesEncrypt(string key, string plaintext): string
fn crypto.aesDecrypt(string key, string ciphertext): string
fn crypto.hashPassword(string password): string
fn crypto.verifyPassword(string password, string hash): bool

fn compress.gzip(string|byte[] input, map meta?): byte[]
fn compress.gunzip(byte[] data): string | byte[]
fn compress.deflate(string|byte[] input): byte[]
fn compress.inflate(byte[] data): string | byte[]
fn compress.gzipInfo(byte[] data): string
fn compress.unzip(string|byte[] src, string destDir): int
fn compress.zip(string destPath, string[] files): int

fn http.get(string url): Future<HttpResponse>
fn http.getSync(string url): HttpResponse
fn http.delete(string url): Future<HttpResponse>
fn http.deleteSync(string url): HttpResponse
fn http.post(string url, string body, string contentType): Future<HttpResponse>
fn http.postSync(string url, string body, string contentType): HttpResponse
fn http.put(string url, string body, string contentType): Future<HttpResponse>
fn http.putSync(string url, string body, string contentType): HttpResponse
fn http.patch(string url, string body, string contentType): Future<HttpResponse>
fn http.patchSync(string url, string body, string contentType): HttpResponse
fn http.request(string method, string url, string[] headers, string body): Future<HttpResponse>
fn http.requestSync(string method, string url, string[] headers, string body): HttpResponse
fn http.encode(string s): string
fn http.decode(string s): string
fn httpserver.serve(int port): HttpServer
fn db.connect(string url): Database
fn db.eq(string column, any value): string
fn db.like(string column, any value): string
fn db.and(string left, string right): string
fn db.or(string left, string right): string
fn db.not(string condition): string

fn tcp.listen(int port): TcpServer
fn tcp.connect(string host, int port, int timeoutMs?): TcpConn
fn websocket.connect(string url): WebSocket
fn sse.connect(string url): SseClient
fn gui.window(string title, int width, int height): Window
fn gui.run(Window window): void
fn syn.window(string title, int w, int h): NativeWindow
fn syn.webview(string title, int w, int h): Window
fn syn.run(NativeWindow win): void
fn syn.px(num n): num
fn syn.pct(num n): num
fn syn.rgb(int r, int g, int b): int

Value methods

TcpConn: read(), readTimeout(int timeoutMs), write(string data), writeTimeout(string data, int timeoutMs), startTls(string serverName, string caPath[, int timeoutMs]), acceptTls(string certPath, string keyPath), close(), isOpen()
string: length(), upper(), lower(), trim(), trimStart(), trimEnd(), repeat(int count), contains(string needle), replace(string from, string to[, int count]), split(string separator), startsWith(string prefix), endsWith(string suffix), indexOf(string needle), lastIndexOf(string needle), count(string needle), charAt(int index), slice(int start, int end), substring(int start[, int length]), padStart(int targetLength, string padString), padEnd(int targetLength, string padString), reverse(), capitalize(), isEmpty(), chars(), lines(), toInt(), toFloat(), toBytes(), toString()
list: length(), contains(any value), indexOf(any value), add(any value), remove(any value), combine(list other), join(string separator), map(fn transform[, int threadCount]), where(fn predicate[, int threadCount]), iter(fn each[, int threadCount]), parallel(fn transform[, int threadCount]), reduce(fn combine, any seed[, int threadCount]), first(), last(), reverse(), sort([bool desc | fn comparator | { inPlace: bool, threads: int }]), sortBy(fn key[, bool desc])
numeric: abs(), round(), floor(), ceil(), min(), max(), toInt(), toFloat(), toDec(), toBytes(), toString()
Date: getTime(), getFullYear(), getMonth(), getDate(), getDay(), getHours(), getMinutes(), getSeconds(), toLocaleDateString(), format(string template)
RegEx: isMatch(string text), find(string text), replace(string text, string replacement), close()

The concrete return type for generic list methods is resolved from the receiver and is shown by hover on the actual expression.

Numeric type limits

Every concrete numeric primitive exposes compile-time MIN and MAX members:

int maxUsers = int.MAX
long earliest = long.MIN
float ceiling = float.MAX

They are available on int, uint, long, byte, float, decimal, and num. Integer limits match each type’s native width. For float, decimal, and num, MIN is the lowest finite value (-MAX); use a small positive literal when a smallest positive magnitude is needed.