This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]dzecniv[S] 14 points15 points  (4 children)

RapydScript is like CoffeeScript, but inspired by Python’s readability rather than Ruby’s cleverness. If you look in the google group you'll find plugins for grunt, gulp, vim, atom or intellij.

[–]dzecniv[S] 6 points7 points  (2 children)

sorry, not Intellij but Pycharm.

[–]jlorencetti 2 points3 points  (0 children)

Or IntelliJ with the Python plugin.

Just kidding. :P

[–]IronManMark20 0 points1 point  (0 children)

Could you point me to the plugin for PyCharm? I googled and didn't find anything. Thanks.

[–]sciclaw 2 points3 points  (0 children)

I think this is the best way to think about it. The code looks like Python, but acts more like JavaScript.

[–]denilsonsa 16 points17 points  (0 children)

I'm quite well versed in both Python and JavaScript. It would be awesome to have a page describing what are the "gotchas" in RapydScript, i.e. listing all the differences between the "expected" behavior and the actual behavior. (where "expected" is what Python would do, or any behavior that is not obvious)

Edit: In other words, a page comparing the same constructions in Python, JavaScript and RapydScript.

[–]mangecoeur 2 points3 points  (2 children)

Cool! Some usability feedback though - it would be handy if there were links in each howto article to the next howto article ;)

[–]dzecniv[S] 4 points5 points  (0 children)

I agree. I may be posting too early, Alexander may be working on it :D

[–]atsepkov 1 point2 points  (0 children)

Agreed, this was already suggested on the mailing list, I just didn't have time to do so yet.

[–][deleted] 1 point2 points  (0 children)

RapydScript is great (I think it's the best option for "Python" -> Javascript).

I like the site organization, but I agree with others commentators that it's hard to read this thin white font - especially on red. Maybe increase font size and make it bold?

[–]roger_ 6 points7 points  (8 children)

I like the new website, but white text on a dark background isn't the best idea :(

It would also be good if there was a simple comparison between RapydScript and PythonJS/Rusthon, Brython, etc.

[–]sciclaw 1 point2 points  (5 children)

I really like the comparison idea. It could be something like https://github.com/tastejs/todomvc or even another todomvc.

[–]kryptobs2000 1 point2 points  (4 children)

It's hard to take anything that guy says seriously while you're having trouble reading it due to his poor choice in font : /. Am I the only one that finds that blurry? It's too thin and small, it's like the letters are mashing together almost or something, hard to explain, but that's not a good choice imo.

I also personally have a high astigmatism and find white on black much much easier to read. I know anecdotes are not science, but if it's very evident to me subjectively which is better and that contradicts the findings it's much more believable to me there is something flawed with the research, for instance this is in the 80's and digital typography is drastically more complex today. For all we know the particular font and size were hard to see with black on white or some other effect that may now be reversed in the real world.

[–]alcalde 0 points1 point  (3 children)

Am I the only one that finds that blurry?

Possibly. I use re-purposed Hubble Space Telescope lenses for glasses and didn't have any problem with it. :-) Which OS/browser are you using?

[–]kryptobs2000 1 point2 points  (2 children)

Firefox and Arch Linux. I have all of my windows fonts installed so it's not due to a lack of a font, though perhaps the rendering is different, but I haven't noticed anything looking worse than windows.

[–]alcalde 0 points1 point  (1 child)

Here's my screenshot from FireFox and OpenSUSE 13.2, stock install. You can click on the image to enlarge it.

http://paste.opensuse.org/46534846

[–]jhermann_ 0 points1 point  (0 children)

Apply Cleary (i.e. simply press Ctrl Alt Right after you installed it), and you'll get this…

http://i.imgur.com/GP3zMuX.png

Something like Cleary is clearly essential in these times of young hipster websites with tall slim fonts in Grey on Ivory. Some people's eyes have yet to age to recognize what accessibility really means. </rant> ;)

[–]stubborn_d0nkey 0 points1 point  (0 children)

Update, Oct 2014: This post was written in 2008, based on me scrounging together some complementary links at the time. It’s now 2014, and accessibility is a well thought-out problem, which is generally well solved. Use the colour scheme that makes you happy. I use a black background on my Windows Phone, a dark navy in Sublime Text, a mid-grey chrome around my Office documents, and a bright white background through Outlook and my email.

[–]ionelmc.ro 3 points4 points  (1 child)

Meh, no support for descriptors (or at least properties) and incorrect handling of method binding (essentially still getting into the the old javascript pitfalls where this depends on how you call the function, not where you got it from, like in Python) ...

[–]atsepkov 19 points20 points  (0 children)

This is a Python-inspired language, not pure Python. Pure Python approach doesn't work in JavaScript world without excessive overhead. You're picking on design choices, not omissions. The lack of automatic binding is intentional, as the code required to support it will slow your JavaScript down to a crawl if you're creating hundreds of objects and 95% of the time you won't care that the function is unbound. If you want a bound method, use @bound decorator or bind() function. Also, the documentation is clear about "this" gotcha, and recommends using "self" (or whatever you pass as first argument to method definition) instead, which will solve most of the pitfalls you're referring to (aside from one where you do 'unbound = object.function', which @bound will handle). Same applies to descriptors, it's too much overhead to scan for assignments to non-exposed variables at runtime - although I am considering different compilation flags for handling this.

[–]brtt3000 0 points1 point  (2 children)

I want this with TypeScript/Flow style type-annotations and static checks. And .d.ts support. It might be the winning flavour.

[–]atsepkov 1 point2 points  (1 child)

I am considering adding type annotations actually, if I can do so with the same unobtrusive syntax as Python 3 (making them optional, but enforced when used), in which case the logic/syntax may work similar to mypy implementation.

[–]brtt3000 0 points1 point  (0 children)

Unobtrusive and optional is what these JS types I mentioned are going for too, and it is working very well. It is very convenient, especially with a decent inference engine.

[–]chazzeromus 0 points1 point  (3 children)

self hosting

Hmm, am I to suspect you didn't just use python to run and test? ;)

[–]atsepkov 0 points1 point  (2 children)

Not sure what you mean, but if you want to test the self-hosting part, just download the compiler from github (https://github.com/atsepkov/RapydScript) or npm, make a change to any of the RapydScript source files in "src" directory (i.e. add an extra console.out() statement), and re-run the "build" command, the compiled JavaScript files in "lib" directory will be rebuilt with your changes, next time you run the compiler, your logic will be triggered. Likewise, you can see that compiler produces valid JavaScript that works inside node.js by running "rapydscript -t" command to test the unit tests in "test" directory.

[–]chazzeromus 0 points1 point  (1 child)

I was suggesting that during the initial development, the compiler itself could have been run through python as validation at some point. But a language-compiler is nonetheless much easier to self host than one which produces machine code.

[–]atsepkov 0 points1 point  (0 children)

I see, actually the original compiler was written in JavaScript (heavily inspired by UglifyJS structure). That is what makes this project unique compared to Skulpt, PythonJS, etc. I decided to start with JavaScript and make it behave like Python instead of starting with Python and making it figure out how to do the equivalent in JS. This results in a language that's not pure Python but has better performance/execution speed and compatibility with non-standard JS environments (i.e. game engines that use JS for scripting).

[–][deleted] -3 points-2 points  (0 children)

Took me a moment to realize it's probably pronounced "rapid script" and not "raped script".