3 ms·
I don't really understand how the example could be considered to have a "cleaner, more readable syntax" than the equivalent CoffeeScript. It's perhaps fair to
by bshimmin 12y ago
I don't really understand how the example could be considered to have a "cleaner, more readable syntax" than the equivalent CoffeeScript. It's perhaps fair to say that it presents a syntax that is more familiar to Python developers.
`self` is also a poor choice of name for a reference to "the object itself": https://developer.mozilla.org/en-US/docs/Web/API/Window/self https://developer.mozilla.org/en-US/docs/Web/API/Window/self
- dheera 12y agoFor readability, sure, I agree CoffeeScript and Python aren't too far off. However, I'd much, much rather have Python scoping than JavaScript scoping.
- e12e 12y agoWell, I think the line: "To those familiar with CoffeeScript, RapydScript is like CoffeeScript, but inspired by Python’s readability rather than Ruby’s cleverness." sums up the idea nicely. CoffeeScript took a strange turn a good while back (I think at the "literate" rewrite) -- where it sort of re-introduced behaviour similar in feel to missing-semicolon-maybe-a-bug-maybe-intended-behaviour... and departed from being "nicer javascript" to become more of "a language that compiles to javascript". The mapping between the input and output javascript seems quite straightforward for these examples -- and the syntax seems simple(r) at first glance. [ed: huh, speaking of semicolons and such, I just took a look at https://github.com/atsepkov/RapydScript https://github.com/atsepkov/RapydScript -- and it mentions: "Note the comma on a new line following a function declaration, it needs to be there to let the compiler know there are more attributes in this object literal, yet it can't go on the same line as the function since it would get parsed as part of the function block. Like Python, however, RapydScript supports new-line shorthand using a ;, which you could use to place the comma on the same line:" Yeah, well. Semicolon-sometimes is worse than semi-colon always. The fact that it's shorthand for '\n' makes it perhaps even worse. Other than that, I still like what I've seen.]