Jeebox Language Introduction

Jeebox is an extensible language for describing code, concepts and stories.

Here are some examples:

Code print "hello world" arr[n] = obj.func(var)

Concepts dogs are animals all~matter has gravity

Stories @Fred ran #until @Fred was tired how::can (someone fall so~far) #without %realising it

Jeebox has some really cool properties...




Extensibility



The most important thing, is that Jeebox is "extensible".

There are no keywords necessary to parse Jeebox. Not "Return" or "if" or "loop" or anything. And yet, it will sensibly parse such constructs.

// "select" and "function" are not keywords, but are correctly parsed. function example ( |int| a b c ) { } select (A, B, C) from T where (D > 0) // "if", "contains" and "mod" are not keywords, but are correctly parsed. if (x contains y) { x = a mod b }




Comments and lines



Comments are // and /**/, just like C++ comments.

Line endings are CR, LF, and comma! Commas and lines are interchangable. Even function calls in Jeebox can be expressed using lines to separate items.

x = MyFunc(AVeryLongName, AnotherLongName, TheseNamesGetTooLongForOneLine) x = MyFunc( AVeryLongName AnotherLongName TheseNamesGetTooLongForOneLine )

Actually, even comments are considered end of line. This is nice, because it makes it impossible to make unreadable comments, like in C++ where you can put a comment in the middle of a line.

if /*hello*/ (test) { func1/*bye*/(b); } // C++ comments
/*hello*/ if (test) { func1(b) } /*bye*/ // Jeebox comments

Want multiple statements on a single line? Sure, commas are lines, remember?

x = y + 1, if x > z {return}



Strings and lists only!



An interesting, and exciting thing, is that Jeebox's abstract syntax tree (AST) is defined purely in terms of strings, and lists. Nothing else. This makes Jeebox easy to understand, process, and generate.

In Jeebox, an AST for "a=(b+c)" would look like:

(rel: (thg: "a") (opp: "=") (bra: (rel: (thg: "b") (opp: "+") (thg: "c") ) ) )

That AST is also valid Jeebox, meaning we could parse that and turn it back into "a=(b+c)".




Cleanliness



• No semi-colons used to end lines like in C++.
• Extensibility relies on code structure, not inbuilt keywords. This enforces more consistent code.
• Comments end lines, stopping comment misuse.
• Define your own units (10USD, 808rgb, -3i, 8cm, 1mm).
• Strings understand embedded code (str = "Time: ${test.duration}s").
• General focus on making Jeebox clean. So many small things were given attention that it needs it's own page to list them all.




In summary



Jeebox is an expressive, sensible and powerful new language. Jeebox isn't just modern, Jeebox defines a new era.

The design is open, and easy to develop tools for.

By having zero inbuilt keywords, Jeebox becomes your own playground.




Next: Why not learn more Jeebox syntax?