Support for Coffeescript

38 views
Skip to first unread message

Andrew Camel

unread,
Dec 29, 2010, 6:07:42 PM12/29/10
to jsap...@googlegroups.com
Can we add the option to install the Coffeescript utility into Node.js?

Matthew Francis-Landau

unread,
Dec 29, 2010, 7:54:03 PM12/29/10
to jsap...@googlegroups.com
At the current moment, I am not looking to add specific modules into JSApp.US.  What you can do is load coffee script in from a files that you save on the server.

I have set up a quick demo of how you could use coffee on jsapp at: http://coffee-demo.jsapp.us/  The code is up at http://jsapp.us/s/67
I have also made the version of coffee that I uploaded public, so you can load it into your code if you wish without having to upload your own version.:  require('matthewfl/coffeescript)'

This is something else that I was thinking, but it seemed to not work, you might take a look at it: http://jsapp.us/s/68

On Wed, Dec 29, 2010 at 3:07 PM, Andrew Camel <aca...@gmail.com> wrote:
Can we add the option to install the Coffeescript utility into Node.js?

Matthew Francis-Landau

unread,
Jan 3, 2011, 6:02:51 PM1/3/11
to jsap...@googlegroups.com
Coffee script is now supported by jsapp.us

To use it, you just have to have the suffix .coffee on you file, and jsapp will recognize it as a coffee script and use coffee 1.0.0 to compile it.  This also works with the new command line tool, so if you have a .coffee file on your hard drive you can run jsapp test [filename] to see that file running live.

If you know of other languages that compile to javascript let me know for consideration in inclusion.  



Little rant:
So I kept trying to find a simple way to run coffee script by having an external javascript file that would load in and compile the coffee script, but due to the fact that the code is loaded right before it needs to server a request, it made it hard to do anything with the filesystem without having to set something up to hold the request while waiting for the filesystem.


ggoodman

unread,
Jan 4, 2011, 2:39:00 PM1/4/11
to JSApp.US
It appears that requiring .coffee files does not have the expected
result and appears to silently fail. I realize that this would likely
require some intermediate compilation step and that this may be
tricky.

Also, would it be possible to add the syntax hilighting to the
embedded Bespin? You can find a plugin at:
http://bespinplugins.mozillalabs.com/plugins/38



On Jan 3, 6:02 pm, Matthew Francis-Landau <matthewmatthe...@gmail.com>
wrote:
> Coffee script is now supported by jsapp.ushttp://jsapp.us/s/69.coffee

Matthew Francis-Landau

unread,
Jan 4, 2011, 5:46:26 PM1/4/11
to jsap...@googlegroups.com
OK, so there is now coffee syntax highlighting.  I also added css and html highlighting.

For the problem with including files, I think it was caused by the compiler taking too long,  Before I was loading in the coffee library and just letting it compile in the server process, but this seemed to cause the system to hang for more than 2 seconds, resulting in it getting reset.  (While testing it seems to have a problem with a file longer than about 45 lines or so)  Now the system is using coffee through the spawn interface and starting a new process just for compiling the coffee code.

I hope that this fix works, but if it doesn't, let me know.

Reply all
Reply to author
Forward
0 new messages