19 ms·
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
by mrinterweb 12y ago
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.
- troels 12y agoRuby gems? How'd you figure that?
- BillinghamJ 12y agoYou can very easily expose C/C++ libraries to Ruby. Totally native too - not hacking it together.
- troels 12y agoRight - but node.js is already a C++ project, so I don't see the difference?
- mrinterweb 12y agoRuby gems can be written using C extensions.
- mcantelon 12y agoNode = V8 + libuv, so they'd likely have to integrate with libuv.
- tlrobinson 12y agoNot Node.js-compatible, but there are libuv bindings: https://github.com/creationix/dukluv https://github.com/creationix/dukluv
- creationix 12y agoIt could be node compatible. I'm just not done. Personally though I prefer the libuv APIs over the node APIs.
- sitkack 12y agoDoesn't a node shim at least get all the libs from NPM?
- bigtunacan 12y agoI'm not sure this is a good idea either; but if it's possible we need to do it just because we can!
- checker 12y agosheer - nothing other than; unmitigated (used for emphasis). shear - cut the wool off (a sheep or other animal).
- mrinterweb 12y agoThank you checker. Attention to spelling detail is not one of my strong suits.
- byroot 12y agoIt's already done often, especially for frontend gems. See execjs [0]. [0] https://github.com/sstephenson/execjs https://github.com/sstephenson/execjs
- mrinterweb 12y agoI'm surprised I haven't heard to that gem. I would assume that adding Duktape as another supported runtime to execjs would be possible.
- byroot 12y agoIt's what power the coffeescript and uglifier support in Rails. You may not have heard of it, but you likely used it.
- joshpeek 12y agoHa, I guess someone started this awhile ago. https://github.com/judofyr/duktape.rb https://github.com/judofyr/duktape.rb I opened a PR update it to 1.0.
- joshpeek 12y agoIf someone publishes a ruby-duktap c extension, I'll definitely get that supported in ExecJS.