News for hackers. Stuff that matters.
Re:Duktape: an embeddable JavaScript engine by mrinterweb on Thursday December 04, 2014 @03:28PM (#8701441)
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.
Re:Duktape: an embeddable JavaScript engine by bigtunacan on Thursday December 04, 2014 @03:41PM (#8701490)
I'm not sure this is a good idea either; but if it's possible we need to do it just because we can!
Re:Duktape: an embeddable JavaScript engine by mcantelon on Thursday December 04, 2014 @03:41PM (#8701489)
Node = V8 + libuv, so they'd likely have to integrate with libuv.
Re:Duktape: an embeddable JavaScript engine by tlrobinson on Thursday December 04, 2014 @03:48PM (#8701528)
Not Node.js-compatible, but there are libuv bindings: https://github.com/creationix/dukluv
Re:Duktape: an embeddable JavaScript engine by creationix on Thursday December 04, 2014 @04:11PM (#8701657)
It could be node compatible. I'm just not done.

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

Re:Duktape: an embeddable JavaScript engine by sitkack on Friday December 05, 2014 @08:51AM (#8704444)
Doesn't a node shim at least get all the libs from NPM?
Re:Duktape: an embeddable JavaScript engine by byroot on Thursday December 04, 2014 @03:56PM (#8701577)
It's already done often, especially for frontend gems. See execjs [0].

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

Re:Duktape: an embeddable JavaScript engine by mrinterweb on Thursday December 04, 2014 @04:10PM (#8701653)
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.
Re:Duktape: an embeddable JavaScript engine by byroot on Thursday December 04, 2014 @04:30PM (#8701770)
It's what power the coffeescript and uglifier support in Rails.

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

Re:Duktape: an embeddable JavaScript engine by joshpeek on Friday December 05, 2014 @01:30PM (#8705983)
If someone publishes a ruby-duktap c extension, I'll definitely get that supported in ExecJS.
Re:Duktape: an embeddable JavaScript engine by joshpeek on Friday December 05, 2014 @03:43PM (#8706781)
Ha, I guess someone started this awhile ago.

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

I opened a PR update it to 1.0.

Re:Duktape: an embeddable JavaScript engine by troels on Thursday December 04, 2014 @03:40PM (#8701485)
Ruby gems? How'd you figure that?
Re:Duktape: an embeddable JavaScript engine by BillinghamJ on Thursday December 04, 2014 @03:41PM (#8701491)
You can very easily expose C/C++ libraries to Ruby. Totally native too - not hacking it together.
Re:Duktape: an embeddable JavaScript engine by troels on Friday December 05, 2014 @09:23AM (#8704591)
Right - but node.js is already a C++ project, so I don't see the difference?
Re:Duktape: an embeddable JavaScript engine by mrinterweb on Thursday December 04, 2014 @03:43PM (#8701499)
Ruby gems can be written using C extensions.
Re:Duktape: an embeddable JavaScript engine by checker on Thursday December 04, 2014 @03:49PM (#8701535)
sheer - nothing other than; unmitigated (used for emphasis).

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

Re:Duktape: an embeddable JavaScript engine by mrinterweb on Thursday December 04, 2014 @03:53PM (#8701556)
Thank you checker. Attention to spelling detail is not one of my strong suits.