Skip to content

Built-ins

Built-ins are the parts of Emerald that belong to the language itself: the types every program is written with, a few functions available everywhere, the traits that decide how values compare and display, and the errors a program raises. They need no import.

  • Types: Bool, Int, Float, String, List, Dict, Set, tuples, Range, and Bytes.
  • Functions: print, write, input, random, exit, and assert.
  • Traits: Equatable, Hashable, Ordered, and Textual, which a type adopts to choose how its values compare, sort, and display.
  • Errors: Error, and Emerald’s own RuntimeError, AssertionError, EncodingError, InputError, and RecursionError.

The Standard Library holds the tools that come with Emerald, such as files, dates and times, and JSON.