• Stars
    star
    354
  • Rank 120,042 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 3 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A query / expression language for performing computations on JSON-like structures. Tuned for clientside ML feature extraction.

Screen Shot 2022-05-28 at 11 46 17 AM

GitHub license Python Node.js npm version npm version

MistQL is a query language for JSON-like structures, built for embedding across multiple domains. It supports logic for querying and manipulating JSON-like data in a simple, readable manner. MistQL serves as a powerful common expression language across multiple implementations.

For more detailed usage information, please visit MistQL's docs site.

Join the Discord!!

Links

At A Glance

MistQL is an embedded query language.

import mistql from 'mistql';

const animals = [
  {name: 'charlie', species: 'dog'},
  {name: 'mulberry', species: 'cat'},
]

const cats = mistql.query('@ | filter species == "dog" | count')

The primary power of MistQL comes from its strong cross-platform behavior semantics. For example, the following have the same behavior:

# Python
import mistql
import json

query = 'events | groupby type | keys'
print(mistql.query(query, json.loads(data)))
// JavaScript
import mistql from 'mistql'

const query = 'events | groupby type | keys';
console.log(mistql.query(query, JSON.parse(data)))

Developing MistQL

Contributions to MistQL are very welcome!

As MistQL is a small project, there are no formatting requirements for either issues or pull requests.

If you're planning on making a new implementation, ping the discord and we'll coordinate!

For an example PR that adds a function to MistQL, refer to this PR as an example of a new function with moderate complexity.

Code workflow

Code contributions to MistQL should roughly follow standard open source workflows:

  1. Fork the project
  2. Make code changes on your fork of the project.
  3. (if necessary) Pull upstream to bring in new changes
  4. Submit a pull request to MistQL's main branch.
  5. (if necessary) Implement changes requested by maintainers.
  6. Wait for the branch to be accepted and merged by maintainers!

MistQL standard

No MistQL standard yet exists, but we're aiming for the 0.5.0 release of mistql as a standardizable language. After the 0.5.0 release, we will create a language specification, separate from any implementation.

In the meantime, we're actually pretty close.

We have a Lark grammar which defines the language's syntax. This is likely the final grammar that will be formalized into ABNF, although it is possible that we may need to fix minor issues before 0.5.0. I expect this to barely change, if at all.

Additionally, our language-independent test suite is rather extensive and forms the de-facto standard of behaviors, as shared by both Python and JavaScript. While not strictly formalized, the tests and the docs together form a cohesive body of behaviors, that, except for a few minuitae, is of sufficient detail to be standardized.

Directory Structure

MistQL's directory structure is a monorepo, currently consisting of these main directories:

  1. /docs: Documentation Site (hosted at mistql.com)
  2. /js: MistQL's browser implementation (e.g. mistql on npm).
  3. /py: MistQL's python implementation (e.g. mistql on pypi).
  4. /shared: Shared assets between all implementation. Contains the language-independent test suite.

Developing for the docs site

Docs are built via a fairly standard Docusaurus 2 implementation. Please follow Docusaurus's docs for developing for the Docs site.

Developing for mistql on npm

mistql is written exclusively using typescript. Additionally, mistql uses yarn for dependency management, versioning, and uploading. JS-specific tests are stored alongside their implementation, using the suffix .spec.ts. Tests that describe the language itself are written in a language agnostic JSON format in the /shared directory. Writing tests for all feature additions and bug fixes is strongly encouraged.

For all major improvements, it is strongly encouraged to run yarn bundlesize to estimate gzipped impact of MistQL on a browser. MistQL for the browser should, in general, remain relatively close to 5kb.

The directory structure is relatively flat, except for the single src/builtins folder, which contains the implementation of all of MistQL's internal functions.

Developing for mistql on pypi

mistql is a fairly standard python package managed with poetry.

Tests can be run using pytest, e.g. poetry run pytest from within the /py directory.

More Repositories

1

timebomb

A cross-lang library for making sure devs get to solving old important TODOs
TypeScript
65
star
2

lambda-explorer

Tutorial / REPL for the lambda calculus
JavaScript
61
star
3

TinyBaker

Composable, first-order file-to-file transformations in Python
Python
32
star
4

buttery

Minimalistic language for defining HTTP(s) and Websocket APIs
TypeScript
23
star
5

dankify.js

JavaScript
8
star
6

homepage

homepage. based on linjus
HTML
5
star
7

talc

Insta-CLI for your projects!
TypeScript
4
star
8

TinyBakerWeb

Web hosting for TinyBaker transforms
TypeScript
3
star
9

stupid-subscribe

Tiny JS snippet for an extremely simple, extremely stupid data subscriber.
JavaScript
3
star
10

PoorMansCRepl

The Poor Man's C REPL
Shell
3
star
11

bestquotes

My very best quotes
HTML
3
star
12

supplier

Pass values deeply with Python!
Python
2
star
13

softwarelexicon

A big lexicon for software
2
star
14

lazarr

extremely rudimentary lazy eval arrays in js
JavaScript
2
star
15

quick-pad

dead-simple collaborative notepad
TypeScript
2
star
16

subsolver2

Subsolver, second iteration
TypeScript
2
star
17

ReactBoilerplate

A personal react boilerplate I'll use as testing grounds. Pulled from wapi, another dead project.
JavaScript
2
star
18

old-hask-pad

quick-pad but in useful meme language
Haskell
1
star
19

Brainfuck-Interpreter

A simple brainfuck interpreter
C
1
star
20

todo-authless

Proof of concept for dead-simple security model
1
star
21

react-express-pg-boilerplate

really basic boilerplate, replaces my earlier react boilerplate
1
star
22

clia

CLI generation for DevX tooling
JavaScript
1
star
23

versus

Bleep bloop elm time
Elm
1
star
24

bosmer

Python
1
star
25

steamy

1
star
26

ts-package-base

basic ts setup for developing browser npm packages, circa 2021
JavaScript
1
star
27

dot

Shell
1
star
28

tunehelper

1
star
29

hask-pad

quick pad but in useful meme langauge. attempt 2
Haskell
1
star
30

evinism.github.io

For the Internet
CSS
1
star
31

django_ttad

learning django
Python
1
star
32

helm

https://www.youtube.com/watch?v=fq3abPnEEGE
1
star
33

spitelisp

"USE A LISP" ok friend
1
star
34

snektemplate

a snek template
1
star
35

Bangers

A hierarchical state management solution!
1
star
36

art-viewer

view art, yo
1
star
37

oceanic

Small but Mighty React-like
TypeScript
1
star
38

kelli-site

incredible artistry
HTML
1
star
39

wapi

dicking around with sound
JavaScript
1
star
40

botgarden

Bot Garden
TypeScript
1
star
41

typed-si

TypeScript
1
star
42

word-interpolator

a linguistic ditty
Python
1
star
43

polygive

ode to chaotic good
TypeScript
1
star
44

everydayastory

1
star
45

sound-lib-experiments

yet another unfinishable project
Python
1
star
46

echo-chamber-server

server / frontend for echo chamber
1
star
47

poppler

Snapshot of poppler for patching
C++
1
star
48

fp-playground

adventures in fp
Haskell
1
star
49

threegoalsaday

1
star
50

DPEA-Shield-Tool

DPEA Tools by Evin Sellin
1
star
51

totality

a language spec where hopefully every string is a valid program
1
star
52

rl-playground

what in tarnation
Python
1
star
53

indexable-testbed

accompanying material for indexable article
JavaScript
1
star
54

notes

A repo of my notes and undeveloped ideas I have
1
star
55

debby-lang

a toy programming language
Yacc
1
star
56

dumb-web-app

Collaborative Notepad written in Haskell / maybe Purescript
Haskell
1
star
57

foc

CSS
1
star
58

the-unjiggler

Python
1
star
59

quack-pad

quick pad but for ducks
JavaScript
1
star
60

turbo-loop

A python script for audio looping
Python
1
star
61

autobot

create bots from lichess users
Python
1
star
62

exus

An unfinishable project
JavaScript
1
star
63

parallax

a simple project management utility
JavaScript
1
star
64

biome

another unfinishable project
JavaScript
1
star
65

sub-solver

A simple webgame for solving substitution ciphers
JavaScript
1
star
66

keygame

was playing around with this, keeping up w/ a beat.
HTML
1
star
67

browsalytics

ml feature extraction for the browser
JavaScript
1
star
68

three-daily-goals

Three Daily Goals
1
star
69

twentyplus

1
star
70

homepage-secret

secret homepage
JavaScript
1
star
71

fish

live updating swarm simulation ui, probably. idea stolen from @ryounes and the Monterey Bay Aquarium open ocean tank
JavaScript
1
star
72

synchron

in many ways an application of the lessons i learned with distly
JavaScript
1
star
73

trill

HTML
1
star
74

evinism

it me
1
star
75

snowdec

1
star
76

DrinkingGames

A repository of drinking games
1
star
77

palin

palindrome generator
Python
1
star
78

lisa-site

important content
HTML
1
star
79

js_phys

A prototype JS physics engine for demonstrating that I can do OOP.
JavaScript
1
star
80

talk-dumping-ground

for resources associated w/ various talks
JavaScript
1
star
81

anticipher

like subsolver but one v one
1
star
82

cryptogrammus

Sub Solver 2
1
star
83

blog

TypeScript
1
star
84

audimon

Rust
1
star
85

confettize

you want confetti? here you goooo
JavaScript
1
star
86

CVS

A design pattern!
1
star
87

distly

a stochastic distributed system simulator
JavaScript
1
star
88

wreath

cloud computing as a language
1
star
89

graveyard

scratchpad repository for scripts and other useless items i write for no reason.
JavaScript
1
star
90

natural-numbers

A tool for people who think the natural numbers are cool but induction is dumb
HTML
1
star