Skip to content

Standard Library Overview

CacaoLang includes a rich standard library with functions for common tasks.

Categories

Array Functions

  • len() - Get length
  • push() - Add element
  • pop() - Remove last element
  • map() - Transform elements
  • filter() - Keep matching elements
  • reduce() - Combine elements

Math Functions

  • sqrt(), pow(), abs()
  • floor(), ceil(), round()
  • min(), max()
  • random(), random_int()

String Functions

  • str(), uppercase(), lowercase()
  • substr(), split(), join()
  • String interpolation with #{}

File I/O

  • read_file(), write_file()
  • append_file(), file_exists()

Type Functions

  • typeof(), int(), float()

Bitwise Functions

  • bitwise_and(), bitwise_or(), bitwise_xor()
  • shift_left(), shift_right()
  • to_binary(), to_hex()