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 [email protected]. 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>
      ']'
    </>
  </>
</>

Pinned Loading

  1. bablr-vm bablr-vm Public

    A VM for enforcing language rules on agAST trees

    JavaScript 39 2

  2. bablr bablr Public

    BABLR!

    JavaScript 7 1

  3. dev dev Public

    Home for development docs and tools

    JavaScript 1

Repositories

Showing 10 of 45 repositories
  • btree Public

    Functional utilities for working with btrees such as those used in agAST

    bablr-lang/btree’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Sep 28, 2024
  • eslint-config-base Public

    A basic eslint config shared by BABLR projects

    bablr-lang/eslint-config-base’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Sep 28, 2024
  • boot Public

    Compile-time tools for bootstrapping BABLR VM

    bablr-lang/boot’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Sep 28, 2024
  • boot-helpers Public

    Runtime helpers for bootstrapping BABLR VM

    bablr-lang/boot-helpers’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Sep 28, 2024
  • agast-helpers Public

    Helper functions for working with agAST trees

    bablr-lang/agast-helpers’s past year of commit activity
    JavaScript 0 MIT 0 0 0 Updated Sep 28, 2024
  • bablr-lang/bablr-website’s past year of commit activity
    Astro 0 0 0 0 Updated Sep 26, 2024
  • dev Public

    Home for development docs and tools

    bablr-lang/dev’s past year of commit activity
    JavaScript 1 0 0 0 Updated Sep 24, 2024
  • language-en-cstml Public

    A BABLR language for CSTML

    bablr-lang/language-en-cstml’s past year of commit activity
    JavaScript 0 MIT 0 1 0 Updated Sep 19, 2024
  • agast-vm-helpers Public

    Helper functions for working with the agAST VM

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

    A BABLR language for nonbacktracking JS-style regexes

    bablr-lang/language-en-regex-vm-pattern’s past year of commit activity
    JavaScript 1 MIT 0 0 0 Updated Sep 19, 2024

Top languages

JavaScript Astro

Most used topics

Loading…