News for hackers. Stuff that matters.
Re:Show HN: Nice-looking Python bindings to V8 by andersriutta on Monday June 19, 2017 @07:20PM (#14591153)
This allows for calling synchronous JS functions from Python but not async JS functions, right? PyExecJS [0] also doesn't work with async JS, but Js2Py [1] might.

[0] https://github.com/doloopwhile/PyExecJS/issues/20 [1] https://github.com/PiotrDabkowski/Js2Py/blob/05e77f0d4ffe91e...

Re:Show HN: Nice-looking Python bindings to V8 by unusximmortalis on Tuesday June 20, 2017 @01:28AM (#14592396)
"Write Python APIs, then call them from JavaScript using the V8 engine"
Re:Show HN: Nice-looking Python bindings to V8 by andersriutta on Tuesday June 20, 2017 @07:30PM (#14599426)
The author says it works both ways [0] (e.g., this test [1]), but I don't see a test with Python calling async JS.

[0] https://news.ycombinator.com/item?id=14596163 [1] https://github.com/tbodt/v8py/blob/3c727584df684540ce30f2572...

Re:Show HN: Nice-looking Python bindings to V8 by d33 on Monday June 19, 2017 @04:29PM (#14590189)
Nice! I hadn't tested it yet, but I remember trying to run V8 in Python and it was a real mess - I think that even building it was problematic. I might use this project one day. Did you compare your bindings to alternatives?
Re:Show HN: Nice-looking Python bindings to V8 by unusximmortalis on Tuesday June 20, 2017 @01:27AM (#14592390)
If I get it correctly this is V8Py meaning it allows javascript (V8) to call Python scripts, not the other way around.

"Write Python APIs, then call them from JavaScript using the V8 engine"

Re:Show HN: Nice-looking Python bindings to V8 by Twirrim on Tuesday June 20, 2017 @09:32AM (#14594444)
That's what I took that phrase to mean, but if you look at the example in the read me, it appears to be the other way around. Writing python, defining a method, then wrapping that method in a V8 context and running it from within python.
Re:Show HN: Nice-looking Python bindings to V8 by tbodt on Tuesday June 20, 2017 @12:47PM (#14596163)
It's both!
Re:Show HN: Nice-looking Python bindings to V8 by tbodt on Monday June 19, 2017 @04:30PM (#14590202)
No, because there really aren't any alternatives... There is PyV8, which last I checked does not compile on recent versions of V8
Re:Show HN: Nice-looking Python bindings to V8 by gkya on Monday June 19, 2017 @05:34PM (#14590650)
Can anybody tell what's going on with the v8py/kappa.{cpp,h} files?
Re:Show HN: Nice-looking Python bindings to V8 by RandomInteger4 on Monday June 19, 2017 @05:36PM (#14590666)
"// Meme header file. Every project should have one of these. Kappa Kappa Kappa"
Re:Show HN: Nice-looking Python bindings to V8 by jszymborski on Monday June 19, 2017 @05:57PM (#14590763)
I'm a fan of humour in comments, easter-eggs, etc... but for no good reason, this bothers me.
Re:Show HN: Nice-looking Python bindings to V8 by nerdponx on Monday June 19, 2017 @08:08PM (#14591332)
It's forced humor, and a misapplied un-funny version of mildly funny nerd humor at that. It gives me the same kind of chills that I get from people who wear "I <3 bacon" type t-shirts.
Re:Show HN: Nice-looking Python bindings to V8 by dguaraglia on Monday June 19, 2017 @08:57PM (#14591514)
In Spanish we have an expression for the way you feel: "vergüenza ajena", which loosely translates to "feeling the embarrassment someone else should feel for their actions." It's pretty nifty, if not very catchy :P
Re:Show HN: Nice-looking Python bindings to V8 by nerdponx on Monday June 19, 2017 @10:22PM (#14591771)
I like this. There's a lesser-known phrase in English with a similar meaning, "embarrassment transfer".
Re:Show HN: Nice-looking Python bindings to V8 by mjburgess on Tuesday June 20, 2017 @07:05AM (#14593532)
Or, "cringeworthy"
Re:Show HN: Nice-looking Python bindings to V8 by jeroenjanssens on Tuesday June 20, 2017 @09:02AM (#14594250)
In Dutch we call this "plaatsvervangende schaamte".
Re:Show HN: Nice-looking Python bindings to V8 by roywiggins on Monday June 19, 2017 @09:30PM (#14591618)
Apparently it's "fremdscham" in German.
Re:Show HN: Nice-looking Python bindings to V8 by dguaraglia on Tuesday June 20, 2017 @12:45AM (#14592263)
See, that's catchier! Now we are talking.
Re:Show HN: Nice-looking Python bindings to V8 by someSven on Wednesday June 21, 2017 @11:03AM (#14604373)
fremdschämen is the verb
Re:Show HN: Nice-looking Python bindings to V8 by tophattom on Tuesday June 20, 2017 @03:49AM (#14592812)
In Finnish that is called "myötähäpeä"
Re:Show HN: Nice-looking Python bindings to V8 by matthewaveryusa on Monday June 19, 2017 @08:54PM (#14591504)
What kind of t-shirt would you have a positive response to?
Re:Show HN: Nice-looking Python bindings to V8 by dotancohen on Tuesday June 20, 2017 @03:01AM (#14592689)
> What kind of t-shirt would you have a positive response to?

Wet.

Note that this thread ends in a predictable fashion: https://xkcd.com/214/

Re:Show HN: Nice-looking Python bindings to V8 by grimgrin on Tuesday June 20, 2017 @09:37AM (#14594480)
I don't feel good about that feeling. Often when I say something makes me cringe, I later feel judgmental about it. Because I am being judgmental.
Re:Show HN: Nice-looking Python bindings to V8 by gkya on Tuesday June 20, 2017 @07:09AM (#14593553)
What's the meme though, honestly it doesn't look like anything but random cpp abuse to me
Re:Show HN: Nice-looking Python bindings to V8 by nerdponx on Tuesday June 20, 2017 @10:00AM (#14594668)
"Kappa" is from the game streaming site Twitch. Unless it means something else entirely and I'm out of the loop.
Re:Show HN: Nice-looking Python bindings to V8 by sargun on Tuesday June 20, 2017 @02:59AM (#14592686)
I also feel like Kappa is related to the Pepe / supremacist folks.
Re:Show HN: Nice-looking Python bindings to V8 by detaro on Tuesday June 20, 2017 @03:02AM (#14592693)
It comes from gaming circles, more specifically Twitch.
Re:Show HN: Nice-looking Python bindings to V8 by startupdiscuss on Monday June 19, 2017 @04:25PM (#14590163)
I might be missing something, but can you show an example of calling the API from javascript?

You seem to be writing it in python and then calling it from within python in the example.

Re:Show HN: Nice-looking Python bindings to V8 by tbodt on Monday June 19, 2017 @04:27PM (#14590176)
context.eval runs JavaScript, which in the example is calling the Python API. expose adds an object into the global JavaScript space.
Re:Show HN: Nice-looking Python bindings to V8 by binora on Tuesday June 20, 2017 @09:17AM (#14594351)
Silly question. Can I use this to interact with a machine learning model written in python from javascript on react native ? It'd be great if someone could point out the feasibility/limitations
Re:Show HN: Nice-looking Python bindings to V8 by tbodt on Tuesday June 20, 2017 @12:47PM (#14596158)
No, it's for running javascript from a python program and allowing that javascript to call python code.
Re:Show HN: Nice-looking Python bindings to V8 by elmigranto on Tuesday June 20, 2017 @12:58AM (#14592308)
Wouldn't it be more performant and less awkward to compile python to JS? Or is it for importing JS code into your python program? Well, why don't compile JS to Python then?
Re:Show HN: Nice-looking Python bindings to V8 by marmaduke on Tuesday June 20, 2017 @02:45AM (#14592636)
If JS code expects to be JITed then transpiled in Python would be quite slow. Transpiling Python to JS is difficult and loses access to various ecosystems e.g. scientific Python.

Having the two runtimes coupled seems to be the ideal way to run both languages in the same process.

Re:Show HN: Nice-looking Python bindings to V8 by droidist2 on Tuesday June 20, 2017 @01:15AM (#14592359)
Interesting. Could this be used to use SciPy stuff from JavaScript?
Re:Show HN: Nice-looking Python bindings to V8 by jdc0589 on Monday June 19, 2017 @04:32PM (#14590222)
there are a LOT of Sublime Text plugins that depend on this.

EDIT: nevermind. i'm dyslexic

Re:Show HN: Nice-looking Python bindings to V8 by tbodt on Monday June 19, 2017 @04:37PM (#14590257)
are you thinking of pyv8?
Re:Show HN: Nice-looking Python bindings to V8 by jdc0589 on Monday June 19, 2017 @04:50PM (#14590350)
damn, yep. good call.