Skip to content

JavaScript Language Support

Maxime Chevalier-Boisvert edited this page Feb 17, 2014 · 20 revisions

JavaScript Support

JavaScript features supported by Higgs include:

  • Objects and methods
  • Dynamic addition and deletion of object properties
  • Prototype-based inheritance
  • Garbage-collection
  • Dynamically resizeable arrays
  • Closures
  • Constructor functions
  • Variadic functions and the arguments object
  • If/switch statements
  • For/while/do loops
  • For-in loop
  • Exceptions and try/catch/finally
  • Dynamic code loading with the load() function
  • Evaluation of code strings in the global scope with eval
  • JSON.parse and JSON.stringify
  • Regular expressions
  • ES6 Map and Set classes
  • UTF-16 strings and string operations
  • Integer and floating-point arithmetic
  • Automatic insertion of missing semicolons

Some features currently missing from Higgs are:

  • The with statement, which is not yet implemented
  • Property attributes (e.g.: non-enumerable, read-only)
  • Getters and setters

Language Extensions

Higgs also supports some custom extensions to JavaScript:

  • Command-line arguments accessible through a global arguments object
  • Low-level primitives for arithmetic and pointer manipulation
  • A Foreign Function Interface (FFI) library for interfacing with C code
  • A simple module system based on CommonJS Modules v1.0

Planned Additions

Support for some ES6 features is planned. Notably:

  • The let syntax for variable declarations
  • Abridged lambda syntax (arrow functions)
  • Template strings
  • For-of loops

These features will be added progressively as the ES6 standard becomes finalized. Implementation of ES6 features will depend on available time and the complexity of the changes required to implement these. Support for the easier to implement features will come sooner.

Clone this wiki locally