DEV Community

Discussion on: 12 Reasons to use Python, not JS, for Front End Web Development

meredydd profile image
Meredydd Luff Author

Well, you're asking the right person - I'm a maintainer of the Skulpt Python-to-JS compiler we use!

The answer is that, inevitably, compiling Python to JS comes with a performance hit. Our responses are twofold: First, we're narrowing the gap, by improving the compiler/toolkit speed (one example: we just landed a deep refactor of Skulpt that speeds up compiled code 2x!). Having said that, front-end Python performance often isn't the bottleneck to making an app feel snappy - it's usually about, eg, being smart about how you load data from the back end.

Second, if you need to do something in JS, you can! Anvil supports calling JS objects from Python, and vice versa (see my Christmas DEV post where I build a 3D model with THREE.js). This means that you can build your whole app with Anvil, and if some part hits a performance limit (or any other limit), you can rewrite that particular component in JS. This is part of our philosophy of always offering an escape hatch -- if you need to go low-level, you can.

richardr91 profile image

In a world opinionated tools, I love the incorporation of an escape hatch! Often as a beginner, what starts off as a simple low level experiment, quickly whirlwinds into a much bigger undertaking what with trying to wrangle so. many. frameworks. Thanks for taking the time to answer to my questions. Off to play!