r/Compilers • u/Ephemara • Sep 22 '26
I turned Markdown (and code blocks) into a full scripting language
https://github.com/ephemara/MarkScriptI built Markscript, a prose-native JIT-compiled bytecode VM where your README or .md files are the executable code. Headings define domains/routines, blockquotes dispatch intents, and tables compile into data matrices. In short, your documentation can now live in the same files as code.
The README.md for the language is executeable. Because its Markdown at the core, there are no syntax errors. It also embeds a full mini-language inside \``markscript` fenced blocks for logic, string manipulation, and math.
Example Below
ServerCluster
NodeMatrix
| NodeID | Host | Port |
|---|---|---|
| 0 | 127.0.0.1 | 8080 |
| 1 | 127.0.0.2 | 8081 |
BootSequence
print "Initializing nodes from table matrix..."
let node_count = 2
let i = 0
while i < node_count:
print("Spawning worker on port " + str(8080 + i))
i = i + 1
2
u/GoAwayStupidAI Sep 22 '26
This is also known as "literate programming".
Lots of neat options in this space!
6
u/Coffee_and_Code Sep 22 '26 edited Sep 22 '26
Would be more interesting if you actually used the table data in the code block... Like, what is the point of the markdown being a part of the language if we have no example of it being used? How does one say
"NodeMatrix".Table[0].Row[i]."Port"? Also, you list "kain" as a prerequisite, but the only reference to that project is a dead link at the bottom.1
u/FransFaase Sep 22 '26
I wrote something similar for putting pieces of C code together. You can give multiple md files as input and the program puts them in the right order to be compiled. I have using it for AoC for some years now. See my IParse repo at github and look for MarkDownC
0
u/DescriptionOptimal15 Sep 24 '26
Vibecoded slop innit
-1
u/[deleted] Sep 22 '26
[removed] β view removed comment