It more resembles LISP with its macros and closures with nice syntax built around those concepts.
I tried to make all the operators match their closest arithmetic, mathematical equivalents. Thus using `^` for exponent and `+` for addition. Since JavaScript does not support bitwise operators cleanly, needing to cast to int32 and generally being disued, I felt they could be better aliased with `bit`, freeing up those operators. Since string concatenation needed some operator as a building block for string interpolation, the freed-up `&` was a ripe candidate for it.
That all said, string interpolation is the typical use case for creating strings, so feel free to just use that if possible. Anything more than that and you might need a templating engine.
var 1 = 5+5 // I would expect: Error 0-9 cannot be used as a variable
var foo = "Hello " "Bob!" "\nAre you there?"
var bar = "Hello " 1
console.info(1) // throw error and refer to var 1
console.info(foo)
"Hello Bob!
Are you there?"
console.info(bar)
"Hello 1" f "Hello"
If f were a string, how would I know I wanted to concat it instead of calling?There is ZERO technological or efficiency related benefit in making () optional, it just makes your grammar parser more complex and slows down compile/interpretation time.
If I would have time and no specs given, then I would write a compiler for Sanskrit. It's one of the oldest languages and as accurate as AI Agent languages. Really accurate. Just google for "Sanskrit Artificial Intelligence" and you will find very interesting publications. Here's something by NASA: http://www.vedicsciences.net/articles/sanskrit-nasa.html
Btw. I've written a simple language+vm in C already using bison,flex etc. Our Prof and other students made a custom CPU that runs on a custom OS made for this language called Ninja. A friend of mine extended it by Object Orientation later.
> Thus using `^` for exponent and `+` for addition
That is good in my eyes.
Of course you can say that since it is defined as such, it's not a issue, but then we could say that any Javascript "Wat" behavior is also defined in the spec.
Personally, I like Perl's period(.) for string concatenation, but I think it can too easily get lost in the line, especially for more complex stuff.
$foobar = "foo" . $bar->{'bar'}