I've been playing around with a Python-to-JavaScript transpiler called Transcrypt lately. I managed to write a very basic React/Material-UI based front-end app written 99.5% in Python as a proof-of-concept. I did a write up with links to code if anyone is interested.
I'm not sure how practical it would be for full blown apps yet, but if you like Python and dislike the JavaScript ecosystem as much as I do, this was a really interesting experiment for me.
Thanks for the article , it looks pretty interesting to use python for front end development as well using Transcrypt.. I’m still wet behind the ears in Python since my forte is .Net & .Net Core... long way to go for me.
I wouldn't recommend it for those that are already comfortable with the JavaScript ecosystem because it is an extra step. But for Python developers like me, this might really open up some doors for front-end development. I actually like the paradigm that React provides, I just don't enjoy the JavaScript toolchain that is otherwise required to use it. Transcrypt is a way to use React with Python that isn't too messy.
Noted !!
Hey John, great write up! I'm also a python developer and evangelist interested in web development, but hesitant to learn javascript for some of the same reasons you mentioned. To be honest though, instead of transpiling python into js, I would be more interested in a python framework that allows you to interact with HTML and css directly. Have you heard of anything like this?
There is a great blog post by Anvil called "Running Python in the Web Browser" that does a great job of outlining the currently available options. Anvil itself is a pretty interesting paradigm, especially if you had any experience with Visual Basic in the past. Their platform looks to be pretty polished. I'm not crazy about their business model though. That said, you can try it out for free.
I'm currently using Transcrypt to create a more real-world React application for a client, and the process is going very well. In terms of developing the application, I never really have to think in JavaScript. Using React, the CSS is embedded in the framework, and there is no HTML other than the index.html entry point. Using React does make you think from a functional programming perspective though.
I started doing another write-up of the process itself that is more of a how-to. I'll post a link here when I have it done.
Very interesting read! Anvil seems like a useful tool, but I think its features are too tightly coupled to the platform. The solution I was thinking of was mentioned at the end of the article: it mentions that Mozilla took over a project which implements CPython in WebAssembly. This would create a platform-independent distribution which could be the basis for numerous UI frameworks.
And yes please keep us updated on your adventures with Transcrypt, would love to know more about how to use it and what works well.