node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »



This is an example of datscript, a data processing language for moving, manipulating, and organizing data.

This is just a proof of concept - it doesn't function yet


in demo.ds

a = clone a/b
b = load ""
a | filter "hello"

Execute the datscript

$ npm i -g datscript
$ datscript demo.ds

how it all works

  1. first, the grammar of the language is described in grammar.y
  2. the grammar file uses jison, which is a JavaScript implementation of bison.
  3. the grammar file contains both a lexer and a parser.
  4. the parser must emit the SpiderMonkey Parser API which is fed into escodegen to generate valid JavaScript syntax.
  5. the resulting script is then fed into the vm module and executed in a sandbox with a special set of globals.


Overall, the goal of datscript is to create something people will use. As such, it should do a good job of meeting the constraints of non-experts who deal with lots of semi-structured data.


  • data might be dirty
  • data may come from various sources, like spreadsheets, websites, csv files, etc
  • people using datscript may be non-programmers


  1. generate a new grammar.js file with npm run grammar.js