148 karma · joined November 12, 2014
With go-duktape, you can compile CandyJS just lake a normal Go package without any other tool or library.
Other reason is that many of the features are based on ECMA6 Proxy, something that is not supported on v8.
But the main goal of the project is be fully transparent more than the performance. At the very beginning I was making every case by hand but this is a endless work: https://github.com/mcuadros/go-candyjs/blob/54c8beb723aa8b1b...
I will take a closer look to the NaN issue and also a closer look to your code.
BTW I made a PR to go-duktape based on you fork: https://github.com/olebedev/go-duktape/commit/65f0be48ece4f6...
A good example could be a chan bot in Go with plugins written on JS. (like https://github.com/djosephsen/lazlo) but with CandyJS the effort to make this will be minimal, since you can use the same structures on JS and Go.
About the performance, CandyJS javascript is much slower than pure Go, since the reflection is very expensive.
A small quick bench of this example: https://github.com/mcuadros/go-candyjs/blob/master/examples/...
Pure Go: 165951 requests
CandyJS: 36304 requests
That means that CandyJS is 4,5 times slower than pure Go. Both
About the pool of workers, they share the stack? Or how you keep the same status on each.
BTW this behaviour is undocumented, I will fix that.