Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

So overall this is an interesting take on Javascript. I like that much of it gets precompiled away (constants, etc). I'm not so fond of "&" being string concatenation. I like Perl6's "_" better, it reads well. Also:

> || - or, can no longer be used with and unless one group is in parentheses

Seriously? Do you require the "+" and "" operators to have parentheses around them? Why do people think order of operations is hard with "and" and "or"? I really* don't get it (and always turn off compiler warnings about that when working with C).

Also, "ownskey" is a bit of a mouthful. Why not ".?" ("?." would be "get key if object isn't null")?



Most of the time, string concatenation is unnecessary with interpolation: "$alpha $bravo" means alpha & " " & bravo.

The reason `and` and `or` are best in parenthesized groups is that it creates confusion in the precedences otherwise. asking someone what `alpha and bravo or charlie` means can be confusing if there's no obvious grouping (like a standard mathematical operator's) giving `and` more precedence than `or` or the other way around.

You actually can use `!.` as an "owns access", as used in `alpha!.bravo`, which means `if alpha ownskey \bravo then alpha.bravo`.

And yes, `?.` means an "existential access", as used in `alpha?.bravo`, turns into `if alpha? then alpha.bravo`.

You can also mix these with `?!.` and it works as expected. :)


The thing about "and" and "or" is that there is obvious grouping--it stems from boolean logic where there is an order of operations ('or' is like '+' and 'and' is like '\*'). There's really no excuse to pander to people that can't or won't memorize the order of operations for boolean logic.

BTW, I don't like coming across super critical, but this is a pet peeve of mine. This particular issue really gets under my skin (I always pass -Wnoparenthases to gcc). Overall I am very impressed with Gorillascript. I love the macros, the functional programming stuff and the basic terseness of it all.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: