Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Out of sheer curiosity, I wonder if duktape can run node? If so, I would think it to be possible to repackage node libraries as ruby gems. Not saying this would be a good idea, I am just wondering if it would be possible.


I'm not sure this is a good idea either; but if it's possible we need to do it just because we can!


Node = V8 + libuv, so they'd likely have to integrate with libuv.


Not Node.js-compatible, but there are libuv bindings: https://github.com/creationix/dukluv


It could be node compatible. I'm just not done.

Personally though I prefer the libuv APIs over the node APIs.


Doesn't a node shim at least get all the libs from NPM?


It's already done often, especially for frontend gems. See execjs [0].

[0] https://github.com/sstephenson/execjs


I'm surprised I haven't heard to that gem. I would assume that adding Duktape as another supported runtime to execjs would be possible.


It's what power the coffeescript and uglifier support in Rails.

You may not have heard of it, but you likely used it.


If someone publishes a ruby-duktap c extension, I'll definitely get that supported in ExecJS.


Ha, I guess someone started this awhile ago.

https://github.com/judofyr/duktape.rb

I opened a PR update it to 1.0.


Ruby gems? How'd you figure that?


You can very easily expose C/C++ libraries to Ruby. Totally native too - not hacking it together.


Right - but node.js is already a C++ project, so I don't see the difference?


Ruby gems can be written using C extensions.


sheer - nothing other than; unmitigated (used for emphasis).

shear - cut the wool off (a sheep or other animal).


Thank you checker. Attention to spelling detail is not one of my strong suits.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: