Memelang: Token-Terse Query Language HOLTWORK LLC released Memelang 11.04, a terse query DSL intermediate representation that it says cuts LLM token costs for text-to-SQL by translating low-token queries into higher-token SQL, citing a 20-token Memelang query that expands to 36 tokens of SQL. The patented language uses an axial grammar of Axis2, Axis1, Axis0 and Cell, with whitespace triggering new cells, and ships with a copy-and-paste prompt for LLMs plus examples covering filtering, grouping, sorting and similarity search. HOLTWORK positions Memelang for systems emitting billions of SQL queries daily, where the token reduction lowers compute spend. Memelang Memelang is a terse query language that substantially reduces compute costs for LLMs emitting billions of SQL queries daily. Low-token Memelang is emitted as an intermediate representation which is then programatically translated into higher-token SQL for the database. Example: Memelang 20 tokens roles actor :$a="Mark Hamill";movie ;@ @ @;actor $a SQL 36 tokens SELECT x.actor,x.movie,y.movie,y.actor FROM roles AS x,roles AS y WHERE x.actor='Mark Hamill' AND y.id =x.id AND y.movie=x.movie Copy all code Copy-and-paste this code into your LLM to ask how Memelang works info@memelang.net | c 2026 HOLTWORK LLC | Patented MEMELANG is a terse query DSL IR for LLM text-to-SQL Axial grammar: Axis2 - Axis1 - Axis0 - Cell Whitespaces are syntactic and trigger "new Cell" Never space between operator/comparator/comma/flag and values MEMELANG VER = 11.04 basic syntax = ' table WS column WS ":$" var ":" "min"|"max"|"cnt"|"sum"|"avg"|"last"|"grp" ":" "asc"|"des" "<= " "\"" string "\"" "="|" ="|" "|"<"|" ="|"<="|"~"|" ~" string|int|float| "$" var |"@"|" " ";"' examples = ''' %mode=tab; roles id :int 0; rating :DESC="Decimal 0-5 star rating of performance";:dec 0.0;<=5; actor :DESC="Actor's full name";:str; movie :DESC="Movie's full name";:str; character :DESC="Character's full name";:str;; actors id :int 0; name :DESC="Actor's full name";:str; age :DESC="Actor's age in years";:int =0;<200;; movies id :int 0; description :DESC="Brief description of movie plot";:str; year :DESC="Year of production AD";:int 1800;<2100; genre scifi,drama,comedy,documentary;:str; title :DESC="Full movie title";:str;; actors name ; roles actor @;; movies title ; roles movie @;; roles id :gct=1;; roles movie :grp; actor :grp; character :gct=1;; actors id :gct=1;; movies id :gct=1;; %mode=qry; """ All movies """ movies ;; """ Every role """ roles ;; """ Titles and descriptions for movies """ movies title ; description ;; """ Actor name and ages """ actors name ; age ;; """ Actors age 41 years or older """ actors age =41; ;; """ Role 567 and 8901 """ roles id 567,8901; ;; """ Films with dystopian society narratives sim .33 """ movies description <= "dystopian"<0.33; ;; """ Movies titled with Star released in 1977 or 1980 """ movies title ~"Star"; year 1977,1980; ;; """ Actors named like Ana aged 20 to 35 inclusive """ actors name ~"Ana"; age =20;<=35; ;; """ Roles rated below 1.5 for movies before 1980 """ movies year <1980; title ; roles movie @; rating <1.5; ;; """ Roles sort rating descending, movie descending """ roles rating :des; movie :des;; """ All movies before 1970 ordered by year ascending """ movies year :asc<1970; ;; """ Average performer rating at least 4.2 """ roles rating :avg =4.2; actor :grp;; """ Minimum role rating by actor, low to high """ roles rating :min:asc; actor :grp;; """ Roles in movies mentioning robot rated 3+ """ movies description <= "robot"<=$sim; title ; roles movie @; rating =3;; """ Costars seen with Bruce Willis or Uma Thurman """ roles actor :$a~"Bruce Willis","Uma Thurman"; movie ;@ @ @; actor $a;; """ War stories before 1980: top 12 movies by minimum role rating """ movies year <1980; description <= "war"<=$sim; title :grp; roles movie @; rating :min:des;%beg=0;%lim=12;; """ Roles for movies Hero or House of Flying Daggers where actor name includes Li, actor A-Z """ movies title "Hero","House of Flying Daggers"; roles movie @; actor :asc~"Li";; """ Titles containing Here about robots between 1900 and 2000 """ movies title ~"Hero"; description <= "robot"; year =1900; <=2000;; %tab=movies; %val; %col=title; ~"Hero"; %col=description; <= "robot"; %col=year; =1900; <=2000;; %tab=movies; title description year; ~"Hero" <= "robot" =1900; <=2000;; %tab=movies; title; ~"Hero"; description; <= "robot"; year; =1900; <=2000;; %tab %val; movies : title~"Hero"; : description<= "robot"; : year =1900; <=2000;; ''' import re, sys, json from typing import Optional, Union, List, Iterator, Pattern, Any Err = SyntaxError SYNTAX CELL PATTERN = 'QUO', r'" ?: ^"\\\n\r |\\. "' , 'EMB', r'\ ?:-?\d+ ?:\.\d+ ? ?:\s ,\s -?\d+ ?:\.\d+ ? \ ' , 'MOD', r'<- |<= |< ' , 'CMP', r' =|<=| ~| =|=| |<|~| ' , 'BIND', r':\$\w+' , 'FLAG', r': a-zA-Z +' , 'VAR', r'\$\w+' , 'REL', r'@\d?|\^' , 'WLD', r' ' , 'EVAR', r'% a-zA-Z0-9 +' , 'SLOT', r' %? a-zA-Z0-9 +' , 'ASSN', r': a-zA-Z0-9 +' , 'TIM', r'\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}' , 'DEC', r'-?\d \.\d+' , 'INT', r'-?\d+' , 'ALN', r' A-Za-z A-Za-z0-9 ' , 'OR', r',' , 'WS', r'\s+' , 'MISMATCH', r'.' , CANON = {' ':' ='} CELL REGEX=re.compile "|".join f" ?P<{k} {p} " for k, p in CELL PATTERN PAD MODES = {'qry','tab'} FLAG KINDS = {'FLAG','BIND','EVAR','ASSN'} LIT KINDS = {'TIM','DEC','INT','ALN','QUO','EMB'} VAR KINDS = {'VAR','WLD','REL','EVAR','SLOT'} DAT KINDS = LIT KINDS | VAR KINDS RELCOORD = { '@0': '-1','-1' , '@1': '-1','-2' , '@2': '-1','-3' , '@3': '-1','-4' , '@4': '-1','-5' , '@' : '-1','+0' , '^' : '-1','end','+0' , } Atomic token class Tok: def init self, kind: str, src: str, canon: Optional str = None : self.kind = kind self.src = src canon = src if canon is None else canon self.canon = CANON.get canon or canon parser = {'QUO': json.loads, 'EMB': json.loads, 'DEC': float, 'INT': int}.get kind self.dat = parser src if parser else src def str self : return self.src def repr self : return self.canon def eq self, other : return repr self == repr other def hash self : return hash self.src def bool self : return bool self.src TOK NULL = Tok 'NULL', '' Sequence of tokens class Seq list Tok : opr: Tok = TOK NULL def init self, items : super . init items self.opr = TOK NULL def str self : return self.opr.src.join str t for t in self if len str t or t.kind=='HOLD' def repr self : return self.opr.src.join repr t for t in self Predicate expression class Cell: flag: Seq left: Seq comp: Tok right: Seq padded = False def init self, src: str : self.left = Seq self.flag = Seq self.comp = Tok 'EQL', '', '=' self.right = Seq Tok 'WLD', '', ' ' toks = for m in CELL REGEX.finditer src : kind = m.lastgroup text = m.group if kind == 'WS': continue if kind == 'MISMATCH': raise Err f'E TOK {text r}' toks.append Tok kind, text i, n = 0, len toks def peek : return toks i .kind if i < n else '' def take : nonlocal i if i = n: raise Err 'E EOF' t = toks i i += 1 return t FLAGS while peek in FLAG KINDS: self.flag.append take LEFT prefix MOD if peek == 'MOD': self.left.opr = take self.left.append Tok 'HOLD', '' t = take if not t.kind in DAT KINDS: raise Err 'E TERM DAT' self.left.append t COMPARATOR if peek == 'CMP': self.comp = take if not peek in DAT KINDS: raise Err 'E DAT' RIGHT values, OR-joined if peek in DAT KINDS: self.right.clear while peek in DAT KINDS: self.right.append take if peek == 'OR': self.right.opr = take if not peek in DAT KINDS: raise Err 'E OR TRAIL' if i = n: raise Err f'E EXPR TRAIL {toks i: }' PLACEHOLDER: OVERWRITE WITH YOUR EMBEDDING FUNCTION def vectorize self, tok: Tok - Tok: if tok.kind == 'EMB': return tok if tok.kind not in {'QUO', 'ALN'}: raise Err 'E EMBED' return Tok 'EMB', json.dumps 0.1, 0.2 @property def single self - Tok: return self.right 0 if self.comp.canon == '=' and len self.right == 1 else TOK NULL @property def literal self - Tok: tok = self.single return tok if tok.kind in LIT KINDS else TOK NULL def find self, kind:str - Tok: return next flag for flag in self.flag if flag.kind == kind , TOK NULL def bind self, tok: Tok : if tok not in self.flag: self.flag.append tok def str self - str: return f"{self.flag}{self.left}{self.comp}{self.right}" def repr self - str: return f"{self.flag r}{self.left r}{self.comp r}{self.right r}" def bool self - bool: return bool self.flag or self.left or self.right GRAMMAR class Axis list : src: str = '' sep: str = None SEPERATOR TOKEN sepreg: str = None SEPERATOR REG EXP sepstr: str = None SEPERATOR OUT empt: bool = False ALLOW EMPTY SUB-AXES? sub = None SUB-AXIS NAME def init self, src: str : if self.sep is None: raise Err 'E AXIS SEP' if not self.sepreg: self.sepreg = re.escape self.sep if not self.sepstr: self.sepstr = self.sep + ' ' self.src= src self.parse src.strip @property def regex self - Pattern str : return re.compile rf''' ?P