PyMiniRacer v0.11.1

Poke objects! Call functions! Await promises!

In this last blog post, I discussed my revival of PyMiniRacer, a neat project created by Sqreen to embed the V8 JavaScript into Python. As of that post (v0.8.0), I had done a light reorganization of the C++ side of PyMiniRacer, but nothing big there yet. Here we talk about some extensions to PyMiniRacer, rolling up the changes up to v0.11.1: JS Object and Array manipulation, directly calling JS functions from Python, async support, and a discussion of the C++ changes needed to make all that work.

Reviving PyMiniRacer

JS-in-Python, in-process, redux!

In this last blog post, I created a helper to call JavaScript from Python using a NodeJS sidecar process. In the post I commented that in- process JS evaluation might be nicer. The old Sqreen PyMiniRacer project had only recently fallen into disrepair. Can we revive it?

TL;DR: Yes! It just took a couple weeks of elbow grease, and new ownership (it me). I now own the two best ways to run JavaScript from a Python program: PyMiniRacer and nodejs-eval.

Running JavaScript from Python using NodeJS

It's RCE, but local!

I wanted to call a pile of JavaScript (actually transpiled TypeScript) from Python, so I could run reinforcement learning on this.

I was dissatisfied with the existing options for calling JS from Python, so I made a new thing!