Standard Library
Donna's standard library lives in a separate package:
donna_stdlib
It provides practical modules for IO, paths, strings, lists, ints, files, shell commands, time, options, results, dictionaries, booleans, floats, and more.
Add it through donna.toml.
[dependencies]
donna = { git = "https://github.com/donna-lang/donna_stdlib", version = ">=0.3.2 and <1.0.0" }
Then import the modules you use.
import donna/io
import donna/string
import donna/list
pub fn main() -> Nil:
let title = string.to_slug("Hello Donna")
let total = list.sum([1, 2, 3])
io.println(title)
io.println(string.from_int(total))
The standard library docs live separately.
Keeping stdlib separate lets it release independently. The compiler should not have to change every time a helper function gets better.