No description
|
||
---|---|---|
q-pidon | ||
q-pilater | ||
LICENSE | ||
README.md |
Q-LANG
Idea by @thea@eldritch.cafe.
You can code only using the letter q
.
Project structure
q-pilator
(WIP) is the interpreter/compilerq-pidon
(WIP) is the code generator
Language spec
Q-lang is a single threaded language, code is written on using q-dir
and q-file
sequentially (q -> qq -> qqq
).
A q-dir
contain at least a q-file
named q
and can contain an arbitrairy number of q-dir
and q-file
A q-file
can contain either an data or instruction.
Instruction is always implied.
Glossary
f
is a filedir
a directory...
meaning repeating
A scope refference the curent execution calling a function make the scope local to this function meaning once the call end memory is cleared.
Instruction
number of q |
INSTRUCT | ARGs | Structure | Details |
---|---|---|---|---|
0 | STDOUT | DATA | ||
1 | WRITE VAR | name - scope - DATA | f,f,dir |
|
2 | READ VAR | name | f |
|
3 | FUNCTION | name | dir |
function are always using the smalest scope possible |
4 | CALL | name - DATA | f, dir |
DATA
Data type are always prefixed by a q-file
containing type info (number of q
).
number of q |
Type | Structure | Details |
---|---|---|---|
0 | boolean | f |
bool |
1 | unsigned int | f |
u32 |
2 | signed int | f,f |
i16 |
3 | char | f |
ASCII |
4 | array | dir \rightarrow (f,data...) |
u16 |
5 | exec | dir \rightarrow INSTRUCTs |
exec return the data contain in the first cell of the local registry |