Fun project, I've always wanted to write web stuff in python.
However I think it is a mistake to go 95% of the way towards imitation. Either you go 100% as to provide compatibility, or you distinguish yourself enough to not cause confusion.
I'd much rather have compatibility with real python code, than constructs such as 'do..while' and '[4 til 9]'.
I am not a fan of any pre-compiler. But, this looks better.
I don't like "do while loop" though. I am not sure what prevents the author to make it something like:
do while(a):
print('This loop will run at least once')
And how about using ES6 generators for Python's generator?
Pythonic JS... this made my day. As someone coming from Python/Django to JS/Node I'd love to see this gaining momentum. (sorry ruby guys, I never liked your girl and her caffeinated cousin)
This looks interesting. I've not used any pre-compilers for JavaScript before, but I may give this a go. Presumably this could be used in the context of node.js, but then really, you might just as well fire up Flask or Django ;)
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.
Well, 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 -- 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.]
Javascript is a beautiful language once you stop blaming it for what it wasn't designed for. I feel that pre-compilers just divide the community up and unfortunately I've seen people going for CoffeeScript for example without even trying to grasp the subtleties of Vanilla JS.
This looks interesting. I am learning python at the moment by making a flask application. It is pretty neat to see how they transpile things like list comprehensions into javascript. I'm currently stuck in angular land right now though, and as much as I would want to try this out refactoring all of my current code sounds like a pain in the arse.
I really like that I can stay in python for everything! That's why I've recently chosen RapydScript to power SilverFlask, a Flask CMS I'm working on as a side project. Really simplifies development and speeds it up.
As much as a love Python, JS really isn't that bad. Seems to me like you could become competent with JS (at least for simple frontend tasks) in the time it would take to familiarize yourself with Rapydscript.
I presume this is meant to be pronounced 'rapidscript' but the 'y' there makes the first bit sound like 'rape-y', which is probably not what you want in a project name :(
One thing I worried about RapydScript is generated variables. Pre-compiler needs to be scope aware. I am not sure how difficult or feasible it would be.
Please stahp with the js transpiler spam if youwant to wriTe js just do it , its not that hards. Certainly easier than wrting lang a and thEn having to troubleshoot the js anyways
However I think it is a mistake to go 95% of the way towards imitation. Either you go 100% as to provide compatibility, or you distinguish yourself enough to not cause confusion.
I'd much rather have compatibility with real python code, than constructs such as 'do..while' and '[4 til 9]'.
I must admit inline 'def():'s are nice though.