JSONTY - A minimalist programming language based on JSON
JSONTY allows you to manipulate variables, perform operations, execute conditions, loops, and define functions.
Github: https://mr-julus.is-a.dev/jsonty/github
fs, readline-sync
You can also use the NPM Package: npm install jsonty
{
"set": {
"x": "10",
"y": "20"
}
}
{
"show": ["(x)"]
}
{
"set": {
"z": "(x) (+) (y)"
}
}
Different mathematical operations: +, -, *, /, =, !=, <=, and >=
{
"if": {
"condition": "(x) (>) 5",
"do": {
"show": ["x is greater than 5"]
}
},
"else if": {
"condition": "(x) (<) 5",
"do": {
"show": ["x is less than 5"]
}
},
"else": {
"do": {
"show": ["x is equal to 5"]
}
}
}
{
"for": {
"i": [1, 5],
"do": {
"show": ["(i)"]
}
}
}
{
"while": {
"condition": "(x) (<) 20",
"do": {
"set": {
"x": "(x) (+) 1"
},
"show": ["(x)"]
}
}
}
{
"fct": {
"name": "calcul",
"args": ["a", "b"],
"do": {
"set": {
"result": "(a) (+) (b)"
},
"return": "(result)"
}
}
}
{
"call": {
"name": "calcul",
"args": ["10", "5"]
},
"show": ["(result)"]
}
{
"ask": {
"q": "Enter your name"
},
"show": ["Hello, (q)!"]
}
{
"try": {
"do": {
"set": {
"x": "1 (/) 0"
}
}
},
"catch": {
"do": {
"show": ["Error detected: (error)"]
}
}
}