TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rapydscript: Python-like pre-compiler for JavaScript

87 pointsby Lofkinabout 10 years ago

16 comments

thomasahleabout 10 years ago
Fun project, I&#x27;ve always wanted to write web stuff in python.<p>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.<p>I&#x27;d much rather have compatibility with real python code, than constructs such as &#x27;do..while&#x27; and &#x27;[4 til 9]&#x27;.<p>I must admit inline &#x27;def():&#x27;s are nice though.
jdkananiabout 10 years ago
I am not a fan of any pre-compiler. But, this looks better. I don&#x27;t like &quot;do while loop&quot; though. I am not sure what prevents the author to make it something like:<p><pre><code> do while(a): print(&#x27;This loop will run at least once&#x27;) </code></pre> And how about using ES6 generators for Python&#x27;s generator?
评论 #9386848 未加载
评论 #9388344 未加载
joeyspnabout 10 years ago
Pythonic JS... this made my day. As someone coming from Python&#x2F;Django to JS&#x2F;Node I&#x27;d love to see this gaining momentum. (sorry ruby guys, I never liked your girl and her caffeinated cousin)
maharg101about 10 years ago
This looks interesting. I&#x27;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 ;)
bshimminabout 10 years ago
I don&#x27;t really understand how the example could be considered to have a &quot;cleaner, more readable syntax&quot; than the equivalent CoffeeScript. It&#x27;s perhaps fair to say that it presents a syntax that is more familiar to Python developers.<p>`self` is also a poor choice of name for a reference to &quot;the object itself&quot;: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Window&#x2F;self" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;API&#x2F;Window&#x2F;self</a>
评论 #9386464 未加载
评论 #9385954 未加载
nezoabout 10 years ago
Nice job here.<p>But to be honest I&#x27;m not a pre-compiler advocate.<p>Javascript is a beautiful language once you stop blaming it for what it wasn&#x27;t designed for. I feel that pre-compilers just divide the community up and unfortunately I&#x27;ve seen people going for CoffeeScript for example without even trying to grasp the subtleties of Vanilla JS.
评论 #9386499 未加载
ameliusabout 10 years ago
&gt; pre-compiler for JavaScript<p>Could it be that the official term is &quot;altjs compiler&quot; (?) [1]<p>[1] <a href="http:&#x2F;&#x2F;smurfpandey.github.io&#x2F;altjs&#x2F;" rel="nofollow">http:&#x2F;&#x2F;smurfpandey.github.io&#x2F;altjs&#x2F;</a>
fokinseanabout 10 years ago
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&#x27;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.
estefanabout 10 years ago
The code examples are incredibly difficult to read. Dark grey on black doesn&#x27;t work.
droelfabout 10 years ago
I really like that I can stay in python for everything! That&#x27;s why I&#x27;ve recently chosen RapydScript to power SilverFlask, a Flask CMS I&#x27;m working on as a side project. Really simplifies development and speeds it up.
kcole16about 10 years ago
As much as a love Python, JS really isn&#x27;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.
craigdsabout 10 years ago
I presume this is meant to be pronounced &#x27;rapidscript&#x27; but the &#x27;y&#x27; there makes the first bit sound like &#x27;rape-y&#x27;, which is probably not what you want in a project name :(
rsaltabout 10 years ago
This is something I was waiting for so long, thanks OP !
rockdoeabout 10 years ago
[2, 1] in [[1,2], [2, 1], [3, 5]]<p>Does it handle this? CoffeeScript was a bit too close to JS to get this correct.
评论 #9386789 未加载
zbyte64about 10 years ago
Step 1) Port it to babel.js<p>Step 2) Profit
评论 #9386425 未加载
miramardesignabout 10 years ago
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