
V8worker – Minimal Go binding to V8 - bpierre
https://github.com/ry/v8worker
======
thinkingkong
By Ryan Dahl: the guy that created node.js. I wonder what else he's been up
to.

------
simi_
I find it interesting that many high profile "noders" have switched to Go
(example [0]), but now its very creator? Wow!

As someone who's switched from (C++/Java to) node to (Python then) Go, I can
understand where they're coming from though.

0: [https://github.com/tj](https://github.com/tj)

~~~
lumpypua
Where are they coming from?

Javascript seems like the future, not Go (speaking as a python engineer).

~~~
themartorana
This feels, apologies, slightly uninformed. JS obviously has a bright near-
term future with so many engineers working on the runtime side, from Google,
Mozilla, etc.

But the speed at which Go has been picked up - especially by high-traffic,
massively-concurrent systems and companies like Google (obviously),
Cloudflare, 6Wunderkinder, BBC, bitbucket, Digital Ocean, Disqus, Dropbox,
ngmoco:), Heroku, Shopify, Tumblr, Zynga...

I realize a list doesn't a language make, (and these are just off the top of
my head) but for each of these companies Go sits at the heart of the most
mission-critical systems, often for extremely fast injection and analysis of
huge data streams. (Funny enough, many come from a Python core, like Disqus
and Dropbox, among others).

I don't think Go's splash was as big as node's, but it's found its way in to
more organizations than not.

~~~
KMag
> I don't think Go's splash was as big as node's, but it's found its way in to
> more organizations than not.

I'm having trouble understanding the second half of this statement. The two
most clear readings are that over 50% of organizations use Go, or that over
50% of the organizations that have used Node now use Go (while still possibly
also using Node). I doubt you intended either of these meanings. How am I
misreading you?

EDIT: do you perhaps mean that over 50% of the organizations that use Node and
have experimented with Go have decided to move forward with more Go projects?

~~~
ChikkaChiChi
I think the statement themartorana is probably contextually inaccurate.

That being said, there are plenty of stories coming out about how companies
are evaluating Go and seeing performance increases in mission critical
application; as opposed to stories of people ripping out pieces of Go and
replacing it with something more optimal for their situation.

~~~
themartorana
_...is probably contextually inaccurate._

Yup, those should have been two separate statements:

1\. Node made a bigger initial splash than go

2\. A large number of organizations that deal with high-volume, highly-
concurrent data sets and API traffic are either in production with Go, or are
experimenting with it. (All the companies I mentioned have Go in production)

------
romankolpak
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
Embed 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
> 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.

------
brianshaler
I imagine there would need to be some work getting this to work with
Node.js/node-gyp/nan. Can anyone speak to the implications of this project and
using Go bindings with node? Is this something that could possibly be done
with a current version of Node/iojs? Or will it require a new version to ship
with Go support built in?

> which will trigger a build of V8

This part gives me the impression changes will need to be made in Node/iojs to
support Go bindings, rather than individual modules being able to plug into an
existing build of V8 in Node. But perhaps I just don't understand exactly what
node-gyp is doing with today's C++ bindings..

------
amelius
Will V8 objects that reference Go objects, and vice versa, be properly garbage
collected? How are these cycles handled by the GC?

~~~
brianshaler
There are shared references? I got the impression the bindings were for
message passing.

> This exposes a non-blocking message passing interface to the V8 javascript
> engine. Go and JavaScript interact by sending and receiving messages.

------
fizzbatter
I wonder if something like this could be paired up with ReactNative?

