Basic input/output operations - console output, file I/O, and type-to-string conversion.
All functions are backed by the Rust runtime (ember).
Prints a string followed by a newline.
Prints a string without a trailing newline.
Prints an integer.
Prints a floating-point number.
Prints true or false.
Flushes the stdout buffer.
Reads a line from standard input. Returns an empty string on EOF.
Reads the entire contents of a file as a string. Returns an empty string if the file is not found or empty.
Writes content to path. Returns 0 on success, non-zero on failure.
Appends content to the file at path. Returns 0 on success, non-zero on failure.
Returns true if the file at path exists.
Returns the size of the file at path in bytes. Returns -1 on error.
Deletes the file at path. Returns true on success.
Renames/moves a file from old to new. Returns true on success.
Converts an integer to its string representation.
Converts a float to its string representation.
Converts a boolean to "true" or "false".
load std.io
io.print("hello, world")
io.print_no_newline("count: ")
io.print_int(42)
io.print_float(3.14)
io.print_bool(true)
let content = io.read_file("data.txt")
let ok = io.write_file("out.txt", "data")
let line = io.read_line()
let s = io.to_string(42)