Fujiyama1
YAMAS stand for Yet Another Markup As Script
I use lots of YAML in different apps. They all have their own implicit logic behind data structure and documentation. Nowadays, YAML is being used as near-script language anyways. (Also it looks like Python.)
- Super simple
- No native loops
- Limited native functions:
- ECHO@
- LINE@
- HTTP@
- BASH@
- PARSE@
Use Rust's "ownership" concept.
- A variable ownership can be passed around using @TAKE and @PUT.
- Only @RUN can be the owner (should we change the name @RUN to @THREAD to make it more clear? ๐ค)
- Once @RUN is run, values in variables are dropped and cleaned
THREAD@:
- ECHO@: "Hello World \n"
- LINE@: "Hello World"
RUN@:
- SET@:
- NAME@: hello
VALUE@: "world"
- SET@
- NAME@: peace
- VALUE@: true
- IF@:
AND@:
- EQ@:
- ${hello}
- "world"
- EQ@:
- ${peace}
- true
THEN@:
- ECHO@: |
Hello World!
RUN@:
- SET@:
- NAME@: hello
VALUE@: world
- IF@:
- EQ@:
- ${hello}
- "world"
THEN@:
- GOTO@: 1
- GOTO@: 2
- GOTO@: 3
- LOC_1@:
- ECHO@: Hello
- RETURN@
- LOC_2@:
- ECHO@: " World"
- RETURN@
- LOC_3@:
- ECHO@: "\n"
- RETURN@
RUN@:
- FN@: World
TAKE@:
- greeting
RUN@:
- IF@: ${greeting} == "world"
THEN@:
- RETURN: "World"
- ECHO@:
FROM@:
- "Hello"
- FROM_CALL@: World
PUT@:
- greeting: "Hello"
- FROM@
RUN@:
- ECHO@:
FROM@:
- "Hello"
- " World"
- "\n"
- PARSE@
PARSE@:
KIND@: JSON
FROM@: |
{
"foo": "bar",
"soo": "taa",
"bip": {
"bap": "boop"
}
}
SET_FROM@:
- bipbap: "bip.bap"
ECHO@: ${bipbap}
- EQ@, NE@, GT@, L@, GTE@, LTE@
EQ@:
- ${foo}
- "bar"
foo === "bar"
- ADD@, SUB@, MUL@, DIV@
@SET_NUM:
- "added"
- @FROM:
- @ADD
- ${added}
- 1
added = added + 1;
- How to Build a New Programming Language by Pietro Gradinetti
- Designing a Programing Language By DuckLang.org
- Programming Language Design by Saeed Mohajeryami
- Syntax Design by LMU CS
- Creating A Programming Language From Scratch by Joao Zsigmond
- Rust and RAII Memory Management by Computerphile
Footnotes
-
Photo by Jules Marvin Eguilos on Unsplash โฉ