|
|
|
|
|
by nathan_f77
4014 days ago
|
|
This is pretty interesting, although I don't know if it's... necessary. What do you think are some of the pros/cons between Go and JavaScript? When would you prefer to use JavaScript instead of Go, or vice versa? I think Go can be more performant than Node.js, but I remember seeing some conflicting benchmarks where V8 can actually manage more RPS. The other thing that comes to mind is how React Native uses JavaScript to manipulate UI Components on iOS. If Google ever supports Go on Android, then this kind of thing could be pretty interesting. |
|
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