AutolangDocs

Standard Library

The AutoLang Standard Library provides a set of highly optimized core functionalities. Most of these are auto-imported, meaning they are available globally without any @import statement. Specialized modules require explicit importing.

1

Core (Auto-Imported)

These types, functions, and data structures are available in every file by default. You do not need to import anything to use them.

Primitive Types

Basic types used for fundamental operations. They are marked with @no_extends and cannot be inherited.

Int

64-bit signed integer. Methods: toString()

Float

64-bit floating point number. Methods: toString()

Bool

Boolean value (true/false).

Void / Null / Any

Special types for VM type-safety.

Core Data Structures

AutoLang provides native, memory-contiguous collections and text manipulation classes for high-performance operations.

Global Functions

Utilities available globally for debugging and I/O.

FunctionDescription
print(val: Any?)Prints value without a newline.
println(val: Any?)Prints value with a newline.
assert(cond, file, line)Throws an Exception if the condition is false.
getRefCount(val)Debug tool: Returns current reference count of a heap object.
2

Modules (Import Required)

These modules must be explicitly imported using @import("path/to/module") at the top of your file.

File System (std/file)

Read Guide →

Provides everything you need to read, write, and manage files and directories.

@import("std/file") if (File.exists("config.txt")) { val file = File("config.txt", FileMode.READ) println(file.readText()) file.close() }

Date & Time (std/date)

Read Guide →

Comprehensive tools for working with dates, times, timestamps, and formatting.

@import("std/date") val now = Date.now() println("Current time: ${now.format("%Y-%m-%d %H:%M:%S")}")

Math (std/math)

Read Guide →

Provides mathematical operations, trigonometry, and random number generation.

@import("std/math") println("Random Int: ${Math.random(1, 100)}") println("Pow(2, 3): ${Math.pow(2.0, 3.0)}")

Performance Time (std/time)

Provides utilities for interacting with system time to measure execution performance.

@import("std/time") val start = Time.now() // ... do some heavy work ... val end = Time.now() println("Execution took: ${end - start} ms")