Re:Show HN: Minimal, modern embedded V8 for Python
by jbaviat on Tuesday August 02, 2016 @03:23PM
(#12212565)
One of PyMiniRacer author speaking.
Use cases are many. For instance, Rails uses ExecJS to minify assets, to compile JavaScript assets from ES6 to older JS runtimes using Babel, for compiling CoffeeScript...
In another world - and that's Sqreen use case for this, JavaScript is the 2016 alternative to Lua.
Furthermore, PyMiniRacer is a lightweight alternative to NodeJS if you are a pythonist and need to run JavaScript, for production or for hacking :)
Re:Show HN: Minimal, modern embedded V8 for Python
by ivan_ah on Tuesday August 02, 2016 @10:04PM
(#12215049)
Could this be used to render React views on the server side?
I'd love to use something like https://github.com/markfinger/python-react but without the need to run node.js server on the side.
Is there an example I can copy to imitate this approach?
Use cases are many. For instance, Rails uses ExecJS to minify assets, to compile JavaScript assets from ES6 to older JS runtimes using Babel, for compiling CoffeeScript... In another world - and that's Sqreen use case for this, JavaScript is the 2016 alternative to Lua.
Furthermore, PyMiniRacer is a lightweight alternative to NodeJS if you are a pythonist and need to run JavaScript, for production or for hacking :)
Link to V8: [jeroenooms/V8: Embedded JavaScript Engine for R](https://github.com/jeroenooms/V8)
I use this sometimes because I am so comfortable with nodejs libraries like Moment that I get lazy to figure out things using R.
Is there an example I can copy to imitate this approach?
1. the C# example from React doc, https://facebook.github.io/react/docs/environments.html
2. The BabelJS example from PyMiniRacer: https://github.com/sqreen/PyMiniRacer/blob/master/helpers/ba...
I would be glad to hear more about that :)
https://github.com/sqreen/PyMiniRacer/blob/master/helpers/ba...
You can easily try it once PyMiniRacer is installed to transpile JavaScript files:
cat some-file.js | python helpers/babel.py