Started an emacs mode.

21 views
Skip to first unread message

Vince Zd

unread,
Apr 21, 2015, 8:55:55 AM4/21/15
to rapyd...@googlegroups.com
Hi all,

In the moto "release early, release often" I also hear "communicate early", so here it is: I started an emacs mode for RapydScript and you can get it here: https://gitlab.com/emacs-stuff/rapyd-mode

It is based on coffee-mode and it basically offers the following:

- automatic indentation (not so clever but ok)
- commands to compile the current file or buffer: rapyd-compile-[file, buffer]
- a menu
- imenu integration
- a minor mode to compile the file at each save: rapyd-compile-on-save-mode
- not to mention syntax highlighting (I may be missing keywords here)

The package has a test suite and I didn't finish to adapt them.

As a side note I removed features from the coffee mode: rapydscript doesn't do source mapping, it doesn't have a repl, and it doesn't have a js2rapyd command (that one I miss… any plan ?). Just in case someone is bored ;)

Please tell me any remark you may have

Vincent


Alexander Tsepkov

unread,
Apr 21, 2015, 10:01:44 AM4/21/15
to Vince Zd, RapydScript
Hey Vince,

Glad to hear this, as for the features you mentioned, I would like both source-maps and repl, just didn't have time to implement them. If anyone else is up to the task, I'd love the help. As for js2rapyd, do you mean this: https://github.com/charleslaw/RapydScript-Decompiler ? It works decently well aside from a couple minor quirks like not detecting classes (which can be remedied by detecting the 'new' keyword and retroactively marking the object as a class) and not tracking global vs local variables (can also be remedied by tracking 'var' locations).

Vince Zd

unread,
Apr 21, 2015, 10:21:49 AM4/21/15
to rapyd...@googlegroups.com, vin...@gmail.com
Great ! great for the link, and to hear you're interested in the other features.
About the repl, I'm curious, I'd like to know how to do it. How would you implement it ?
It seems for me that prompt_toolkit https://github.com/jonathanslenders/python-prompt-toolkit is good solution.

Alexander Tsepkov

unread,
Apr 21, 2015, 10:44:49 AM4/21/15
to Vince Zd, RapydScript
Well, since RapydScript runs via node, I'd use that for repl as well, rather than a Python solution (the smaller the footprint and the necessary languages, the better for a typical user). Node already provides some repl solutions, for example:

And here is a tutorial explaining how to build a custom repl via it: http://derickbailey.com/2014/07/02/build-your-own-app-specific-repl-for-your-nodejs-app/

As far as I understand, all you'd need to override is the eval() function to call RapydScript compilation logic, then native JavaScript would take care of everything else.
Reply all
Reply to author
Forward
0 new messages