I just wanted a small project to experiment with a random programming language, so I chose JSON since it’s so easy to make a parser for it
Absurd Script Object Notation is just a JSON but absurd. Why it’s absurd? well this is a valid ASON Code
}
"name" "Hesham"
"age" 19
"hobbies" ] "programming" "game dev" "compilers" [
"nerd" true
{
You might think it’s absurd because there are no , or : symbols, but in fact, these are optional—just like in JSON. but still those are just the few things that makes it an Absurd JSON.
Since you probably have some sort of ADHD issues, so the tutorial for this Absurd JSON (ASON) will simply be a comparison between JSON and ASON.
"string" \\ this is a comment
- there’s nothing like comments in JSON :3
"string"\\ the `,` is actually optional
] 1 2, 3 4 [
[ 1, 2, 3, 4 ]}
"name" "Hesham"
"age": 19, // the `:` is actually optional
"hobbies" ] "A" "B" "C" [
{
{
"name": "Hesham",
"age": 19,
"hobbies": [ "A", "B", "C" ]
}In lisp-like languages you have something called an s-expression where the first symbol is the callee and the rest is the arguments that gets passed to it.
(+ 1 2 3) ;; 6In ASON we got expression-s
}
"v" )1 2 3 +(
{
{
"v": 6
}and you even can write something into the console with write-line
}
"v" )"Hello World" write-line( \\ This returns null
{
{
"v": null
}}
\\ Arithmatics always returns a number
"a" )2 2 +(
"b" )2 2 -(
"c" )2 2 *(
"d" )2 2 /(
\\ IO
"e" )"Hello World" write-line(
"f" )"file.txt" read-file-to-string(
\\ IDK what i should call it
"g" )33 "xx" defvar(
"h" xx
{
{
"c": 4,
"d": 1,
"e": null,
"a": 4,
"f": "content",
"g": 33,
"b": -4,
"h": 33
}