/crlf

Consistent Representation Language Framework (crlf)

Primary LanguageJavaScript

Consistent Representation Language Framework (crlf)

Use JSON encoding to communicate language-specific abstract syntax trees. Possible uses include:

  • Packaging code for remote execution
  • Intermediate format for language tool-chains
  • Embedding language fragments within another language
{
    "lang": <language identifier>,
    "ast": <abstract syntax tree>
}

The value of the lang property specifies the interpretation of the value of the ast property.

lang value Description
JSON JavaScript Object Notation
VO Abstract Value-Object Expressions
lambda Untyped Lambda-calculus
PEG Parsing Expression Grammars
actor Primitive actions for the Actor-model of computation
BART Blockly Actor Run-Time
Humus Humus Actor-Programming Language

Abstract Compilation

The ast property value represents the source language for a particular type of crlf object. This source consists entirely of abstract values which can be represented by JSON:

  • null
  • Boolean (true and false)
  • Number
  • String
  • Array
  • Object

The lang property value specifies a compiler for this type of crlf object. The compiler translates the source value into an implementation-specific object. The abstract semantics of this object are defined by each language.