Skip to content

Libraries Provided by Higgs

maximecb edited this page Nov 21, 2014 · 3 revisions

This is a list of JavaScript libraries that are included in the Higgs repository and the default Higgs installation.

Custom Libraries

Higgs comes with "batteries included". These custom libraries are not part of the JavaScript standard, but ship with Higgs:

  • console (console logging)
  • csv (Comma Separated Value spreadsheets)
  • dir (directory tree traversal)
  • draw (2D drawing)
  • ffi (Foreign Function Interface)
  • random (random numbers and actions)
  • stdio (C stdio)
  • stdlib (C stdlib)
  • test (unit test utilities)

To access any of these libraries, import them with the require('lib/libname') syntax, for example:

io = require('lib/stdio')

Standard Libraries

These libraries are part of the JavaScript standard and are automatically accessible in Higgs, you do not need to import them. Loading of these libraries can be disabled by starting Higgs with the --nostdlib option.

Runtime Library

The runtime library is always loaded by Higgs and cannot be disabled. It is a self-hosted implementation of core JavaScript primitives, such as arithmetic and bitwise operators. The runtime is the foundation on which the standard library is built. It is implemented in an extended JavaScript dialect using special low-level primitives which allow direct expression of operations such as type tag tests, pointer arithmetic and machine integer addition.