Language
- This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
Language is a language based on the English Language and JavaScript with a little guidance from LUA.
It started out as a sort of annoyance when programming, you know what you want it to do, yet sometimes the logic doesn't feel precise or exactly what you entail due to symbols that have double connotations. Here we abstract away from symbols as much as possible and give power to the actual expression of language.
Implementations
None currently Exist. Seeking help and guidance.
To be honest, i've slowly been implementing a recursive [top-down] parser to convert it to into JavaScript, because BISON/JISON seems daunting to learn in the small amount of time that I have allocated to this idea. If you feel you can help come up with a lexer / parser for this, please let me know. I'd love to have support and help for this.
A language like this one is fairly complex, however I do know it is possible to create, even from the most basic of standpoints as I've implemented the questioning system and iteration system.
Syntax
Language is almost pure English. Beautiful at that.
Variables
Validation
[a-zA-Z][a-zA-Z0-9\_]+
Declaration Logic
(1. THE )?(VARIABLE -> REFERENCE) (2. IS|ARE|AND -> VALUE/VALUE/INCLUSION) (VALUE|VARIABLE)( (IS|ARE|ISNT|AND) (VALUE|VARIABLE))+
- THE is optional, the sentence should determine variable declaration regardless of it's usage. It's only existence is for sentence structure rationale.
- AND equates inclusion, IS & ARE equates value.
Language | JavaScript |
---|---|
the tree and leaves are "growing" |
var tree = "growing", leaves = "growing"; |
the tree is leaves is "growing" |
var tree = leaves = "growing"; |
tree is "brown" |
tree = "brown" |
libraries are "quiet" |
var libraries = "quiet" |
Questions
(IS|ISNT|ARE -> QUESTION_OF_TRUTH) ((((VALUE|VARIABLE )+)QUESTION_MARK?)|( NOT ((VALUE|VARIABLE )+)QUESTION_MARK?)|((AND ((VALUE|VARIABLE )+)QUESTION_MARK?))
Language | JavaScript |
---|---|
result isnt 42 life? |
return 42 == life; |
result is 42 not life? |
return 42 == life; |
result is 42 not life |
return 42 != life; |
result is 42 life? |
return 42 == life; |
result are tree and leaves "growing"? |
return (tree == "growing" && leaves == "growing"); |
These can also be applied to variables.
Language | JavaScript |
---|---|
life isnt 42 |
var life = !42; |
reality isnt life 42? |
var reality = (life == 42); |
life is 44 - 2 and life is 42 not life? |
var life = 44 - 2; life = 42 == life; |
Statements
IF (VARIABLE|VALUE) THEN (LOGIC) (OTHERWISE|ELSE (IF STATEMENT)? (LOGIC))? OK
if life isnt 42 then print life ok
Language | JavaScript |
---|---|
if life isnt 42 then print life ok |
if (life != 42) { console.log(life); } |
If life isnt 42 then print life else print true ok |
if (life != 42) { console.log(life); } else { console.log(true); } |
Iterations
I got tired here, but there is a mountain of things.
Arrays
for indice and value in array then print value ok
var indice = 0; var value; for (indice = 0; indice < array.length; indice++) { value = array[indice]; console.log(value); }
Objects
for key and value in object then print key and value ok
var key; var value; for (key in object) { if (object.hasOwnProperty(key)) { value = object[key]; console.log(key, value); } }