Skip to content
@bablr-lang

bablr-lang

BABLR

come chat on Discord

The BABLR organization's mission is to build next-gen tooling ecosystem to radically raise computer code literacy around the world. It aims to do this by creating standard structural representations of computer code. Much current developer suffering comes from the fact that developers use a wide variety of tools in their work, and these tools interoperate poorly with each other. The particular problem is the absence of any format for code (other than plain text) that all tools share. BABLR aims to define a single representation for code that will be as useful as possible to the broadest group of individuals, then to capitialize on the existance of such a format to build the most richly integrated developer experiences in the world.

There are several closely related technologies under development to solve the problem: CSTML (a serialization format for parsed code), agAST (a JS in-memory sturcture for storing parsed code), and Spamex (a regex-like langauge with structural matching). Each of these technologies is designed to be larger than the BABLR organization and would likely be subject to formal standardization if they are informally successful, as is often the way of things with the web. Instead of writing a formal specification for these technologies, I have instead opted to define them in terms of a reference VM built in Javascript: bablr-vm. This newly-developed streaming parser core which parses code into agAST trees, CSTML documents, or CSTML-ish streams. Because the formats are defined by bablr-vm (and bablr-vm is in alpha), the formats should also be considered to be in alpha and are subject to change at any time up until bablr-vm@1.0.0. For that reason work on stabilizing the vm and these formats is proceeding with all possible haste.

CSTML

Let's say we have a simple JSON expression like this (playground):

[1, true, "3"]

A CSTML represention of the same data will be much more verbose, and it will always contain the complete original text embedded inside it. This is not a format that you are likely to read directly (very often), instead more likely this data will be used to construct a much denser (literal) representation (like the one above) where the extra data is expressed as colorful syntax highlighting and other rich editor features which can enhance rendering and interactivity of the embedded code.

<>
  children[]:
  <Array>
    open:
    <Punctuator balanced=']'>
      '['
    </>
    elements[]:
    <Number span='Number'>
      wholePart:
      <Integer>
        sign:
        null
        digits[]:
        <Digit>
          '1'
        </>
      </>
      fractionalSeparator:
      null
      fractionalPart:
      null
      exponentSeparator:
      null
      exponentPart:
      null
    </>
    separators[]:
    <Punctuator>
      ','
    </>
    #' '
    elements[]:
    <Boolean>
      value:
      <Keyword>
        'true'
      </>
    </>
    separators[]:
    <Punctuator>
      ','
    </>
    #' '
    elements[]:
    <String>
      open:
      <Punctuator balanced='"' lexicalSpan='String'>
        '"'
      </>
      content:
      <StringContent>
        '3'
      </>
      close:
      <Punctuator balancer>
        '"'
      </>
    </>
    close:
    <Punctuator balancer>
      ']'
    </>
  </>
</>

Popular repositories

  1. bablr-vm bablr-vm Public

    A VM for enforcing language rules on agAST trees

    JavaScript 34 2

  2. errawr errawr Public

    Build with better errors! Rawr!

    JavaScript 3

  3. bablr bablr Public

    BABLR!

    JavaScript 3

  4. grammar grammar Public

    A utility for declaring grammars over trees

    JavaScript 2 1

  5. language-regex-vm-pattern language-regex-vm-pattern Public

    A BABLR language for nonbacktracking JS-style regexes

    JavaScript 1

  6. language-json language-json Public

    A BABLR language for JSON

    JavaScript 1

Repositories

Showing 10 of 38 repositories
  • dev Public

    Home for development docs and tools

    bablr-lang/dev’s past year of commit activity
    JavaScript 0 0 0 0 Updated Jun 20, 2024
  • errawr Public

    Build with better errors! Rawr!

    bablr-lang/errawr’s past year of commit activity
    JavaScript 3 MIT 0 1 0 Updated Jun 19, 2024
  • language-uiua Public

    BABLR language for UIUA

    bablr-lang/language-uiua’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Jun 19, 2024
  • language-regex-vm-pattern Public

    A BABLR language for nonbacktracking JS-style regexes

    bablr-lang/language-regex-vm-pattern’s past year of commit activity
    JavaScript 1 MIT 0 0 0 Updated Jun 18, 2024
  • macrome-generator-bablr Public

    A macrome generator for BABLR languages

    bablr-lang/macrome-generator-bablr’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Jun 16, 2024
  • bablr-cli Public

    CLI for running BABLR parsers

    bablr-lang/bablr-cli’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Jun 15, 2024
  • language-cstml Public

    A BABLR language for CSTML

    bablr-lang/language-cstml’s past year of commit activity
    JavaScript 0 MIT 0 1 0 Updated Jun 15, 2024
  • language-json Public

    A BABLR language for JSON

    bablr-lang/language-json’s past year of commit activity
    JavaScript 1 MIT 0 0 0 Updated Jun 14, 2024
  • bablr-vm Public

    A VM for enforcing language rules on agAST trees

    bablr-lang/bablr-vm’s past year of commit activity
    JavaScript 34 MIT 2 9 0 Updated Jun 14, 2024
  • language-blank-space Public

    A BABLR language for tabs, spaces, and line terminators

    bablr-lang/language-blank-space’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Jun 14, 2024

Top languages

Loading…

Most used topics

Loading…