Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narwhal speed #7

Closed
TBD opened this issue Dec 27, 2009 · 4 comments
Closed

Narwhal speed #7

TBD opened this issue Dec 27, 2009 · 4 comments

Comments

@TBD
Copy link

TBD commented Dec 27, 2009

having troubles with CS in interactive mode due Narwhal not finding coffee-script.js I used JSDB.org and it is much faster on small script (sorting an array)

time jsdb test.js

real 0m0.017s | user 0m0.010s | sys 0m0.006s

vs

time narwhal test.js

real 0m1.371s | user 0m1.098s | sys 0m0.150s

is there any plans in having other JS compilers added for interactive mode ?

@jashkenas
Copy link
Owner

Is coffee -i not working for you at all? On the latest 0.1.5? Let me know if it isn't.

So, the interactive mode is still a huge hack -- it's shelling out to the compiler (in Ruby) for every line you type, and then taking that JS back and evaling it. I wouldn't worry too much about the speed.

That said, the idea with Narwhal is to provide multiple backing engines that you can choose from. I haven't tried it, but I think you should be able to install the "k7" engine, which uses Google's V8, and get much faster script execution.

@TBD
Copy link
Author

TBD commented Dec 27, 2009

coffee --version
CoffeeScript version 0.1.5

coffee -i
require error: couldn't find "/Users/tbd/lib/coffee_script/narwhal/js/launcher.js"

if I add Dir.chdir(CS path) in command_line.rb:launch_repl then I get
require error: couldn't find "coffee-script"

narwhal was installed via source /Users/tbd/Software/narwhal/bin/activate

for now I created a command in TextMate CoffeeScript bundle to compile and run it in jsdb and I am happy ;)

@jashkenas
Copy link
Owner

Whoa. Thanks for the bug report -- coffeescript -i was completely broken when running outside of the coffee-script directory, and I never noticed. I've pushed out a 0.1.6 update that fixes the problem. Closing this ticket -- if it doesn't work for you, let me know.

@TBD
Copy link
Author

TBD commented Dec 27, 2009

problem fixed. thank you and keep up the good work !

softprops referenced this issue in softprops/coffee-script Feb 4, 2012
```coffeescript
defer { a : { b: c } }
```

But capture works as usual
yyfearth pushed a commit to yyfearth/coffee-script that referenced this issue May 16, 2012
```coffeescript
defer { a : { b: c } }
```

But capture works as usual
int3 pushed a commit to int3/coffee-script that referenced this issue Feb 14, 2013
```coffeescript
defer { a : { b: c } }
```

But capture works as usual
alangpierce added a commit to alangpierce/coffeescript that referenced this issue Oct 9, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants