4 ms·
Can someone explain motivation for this? Why would someone need Go bindings for V8? What's the practical applications of this? Not trying to be a jerk, just pl
by romankolpak 12y ago
Can someone explain motivation for this? Why would someone need Go bindings for V8? What's the practical applications of this?
Not trying to be a jerk, just plain curiosity
- detaro 12y agoEmbed javascript as a scripting language into a Go app. Build bindings to system functions in Go (e.g. write the common parts of an app in JS, run it in V8, write platform-specific things in Go). Write the next Node.js/Io.js in Go?
- nkozyra 12y ago> Embed javascript as a scripting language into a Go app. Sure, but you could already do that. There are several V8 implementations in Go you could use directly to invoke javascript code, but you'd have to pass values directly in and get return values directly out to interface between the two languages.
- mtrn 12y agoOne use case I see is scriptability: You want to have the flexibility of javascript, but deploy a single binary (Go). There are quite a few js engines/bindings already for go, like duktape, otto, go-v8, ...
- fragglesmock 12y agoMultiple return values zomg is a tempting reason to change .
- aikah 12y ago- Serve assets that need some transformation through a js script(uglify,LESS,...) - Provide a scripting layer to an executable. - Re-implement nodejs in Go ...
- errordeveloper 12y agoIn theory one can reimplement Node on Go runtime, instead of libuv and other libraries Node uses for binding the V8 to the OS.
- psynapse 12y agoThis idea definitely has legs for what I do day-to-day. We have a data aggregation framework with hundreds of bots. Due to the fluid nature of maintaining it we use Python. The trade-off for the productivity we require is performance - we use GEvent to mitigate this to a degree. I have already replaced parts of our suite with components written in Go, but at this point I wouldn't port the pointy end because I don't want to loose the agility that Python allows. If I could spider/parse with JavaScript and at once exploit the Go performance and concurrency features, this would be very attractive. Funnily enough, the previous incarnation of the same solution was written in C++ with a JavaScript run-time used in exactly the same way. It predates Node.js by some years.