Standard library / Standard library overview (std::)

Standard library overview (std::)

std:: is the Silk standard library namespace. The docs/std/ tree specifies the intended API and structure; an in-tree stdlib implementation exists under std/ for Silk currently.

Full reference: overview.

Notes#

  • Design + implementation: many modules have an Supported forms; the overall surface is still evolving.
  • Full reference: overview

Importing#

std:: is available to import by default in normal silk build workflows.

import std::io;
import std::vector;

Examples#

Example: a tiny “hello std” program#

import std::io;
import std::vector;

type VecInt = std::vector::Vector(int);

fn main () -> int {
  let mut v: VecInt = VecInt.init(4);
  v.push(10);
  v.push(32);

  std::io::println("len={d} first_pop={d}", v.len() as int, v.pop() ?? 0);
  v.drop();
  return 0;
}

See also#

Source repository · Edit this page · View Markdown