Thinking about a Python-native frontend - feedback?
Posted by United_Intention42@reddit | Python | View on Reddit | 33 comments
Hey everyone experimenting with a personal project called Evolve.
The idea is to run Python directly in the browser via WebAssembly and use it to build reactive, component-based UIs - without writing JavaScript, without a virtual DOM, and without transpiling Python to JS.
Current high-level architecture (text version):
User Python Code
↓
Python → WebAssembly toolchain
↓
WebAssembly Runtime (in browser)
↓
Evolve Core
┌───────────────┐
│ Component Sys │
│ Reactive Core │
└───────┬───────┘
↓
Tiny DOM Kernel
↓
Browser DOM
Very early stage, but currently I have:
• Python running in the browser via a WASM toolchain
• A tiny DOM kernel
• Early component + reactivity system (in progress)
Next things I’m planning to work on:
- Event system
- Re-render engine
- State hooks
I’m not claiming this will replace existing JS frameworks - this is just an experiment to explore what a Python-native frontend model could look like.
I’d really appreciate feedback from the community:
• Does this architecture make sense?
• What major pitfalls should I expect with Python + WASM in the browser?
• Are there similar projects or papers I should study?
Any honest feedback (good or bad) is welcome. I’m here to learn - thanks!
Dr_Quacksworth@reddit
So let's say I'm a developer in 2025 who knows Python, but not JavaScript or any JavaScript framework.
I could try learning your framework, or I could use an LLM to learn/vibe my way through JavaScript.
What value does your project add vs JS/LLM?
United_Intention42@reddit (OP)
Basically, you don't have to learn my framework syntax. It's 90% the same as writing a pure Python script.
JimDabell@reddit
iOS in Lockdown Mode won’t run WASM, so anybody with strict security settings wouldn’t be able to use apps built with your system.
Have you looked into Wasmer? It feels like it might be a better long-term approach than Pyodide.
United_Intention42@reddit (OP)
I just checked out Wasmer. It sounds better than Pyodide. Will try it. Thanks for suggesting!
devnomial@reddit
https://reflex.dev
Check it once. Frontend in pure python.
the-scream-i-scrumpt@reddit
I was planning to do the same thing but built on top of react native + wasm, my logic was that you could get a lot of leverage from building on top of an existing ecosystem
but totally agree that pyscript and reactpy don't scratch the python-native itch because your python code isn't actually running on the client
tobiasbarco666@reddit
what are you doing for the wasm generation? i've heard wasm compilation in python is still not very mature
United_Intention42@reddit (OP)
Yes, Python to WASM is still immature.
So, I am running complete Python interpreter compiled to WASM (via Pyodide) in browser.
Then Evolve will run on top of that.
outceptionator@reddit
I get that how it happens is different to something like NiceGUI but how does it make the developer or consumer experience better?
tobiasbarco666@reddit
nice! do you have a public repo I could peek later?
United_Intention42@reddit (OP)
Yes - it will be fully open source. I’m just tightening some of the core pieces before making it public so that early contributors don’t run into chaos. I’ll share the repo soon once the base is solid.
tobiasbarco666@reddit
alright, good luck
riklaunim@reddit
What's the goals, point of this project? Why this thing and not PyScript? In the end you will end up with HTML, CSS and Python code doing 1:1 what JS code would do, just like with PyScript.
United_Intention42@reddit (OP)
PyScript just puts Python inside the existing HTML/JS model.
My project replaces that model with a Python-native architecture - new component system, new state handling, new rendering logic.
Yes, the output is still HTML/ CSS, but so is React’s. The difference is the architecture and developer experience.
PyScript is a tool. This is a framework for rethinking how UIs are built in Python.
riklaunim@reddit
What is "Python-native architecture"? What is Pythonic in handling onClick, hover?
Components have place in frontend frameworks. Just please don't tell me you want to replace HTML with nested Python functions or alike... What problems are you trying to solve? do you have any actual examples?
United_Intention42@reddit (OP)
By “Python-native architecture” I don’t mean writing HTML in Python. I mean designing the whole UI model around Python itself: components as real Python objects, state as real Python data, and event handlers as normal Python callables - not strings or templates.
I’m not trying to replace HTML with messy nested functions. The problems I’m solving are brittle templates, HTML/JS/CSS separation, and poor composability for Python devs.
Once the core API is stable, I’ll share concrete examples.
something like this:
riklaunim@reddit
This isn't new. It was tried multiple times and died quickly pretty much every time.
Typical dynamic website will have few hundred or thousand lines of HTML, a lot of JS and CSS. Your example is way to trivial - representing anything non-trivial within Python will be a big mess. And there are already backend Python frameworks that can be used to create endpoints returning HTML and not structured data. Your example is a bad mix of backend endpoints and frontend events handling. This is confusing.
You don't need a Python developer to handle onclick on a website. And if someone wants a SPA JS frontend app with components there is Vue and many other solutions, or even HTMLX for simple needs. People that want to avoid npm hell and other JS problems are likely looking for their frontend framework replacements instead of such ideas.
robberviet@reddit
This. Another day, another HTML wrapper sounds fine but only on toy code, not on real code.
pomponchik@reddit
We need it, but it should be 1. native; 2. compatible with all existing libraries.
Endogen@reddit
I like this. Until now I use reflex (https://reflex.dev/) but I'd be happy to use a 100% Python solution.
United_Intention42@reddit (OP)
I myself tried reflex.
they do reflex code --> fastAPI server --> Update states --> recompile react app --> Update UI.
This is slow and hard to debug.
That's why started building Evolve.
jvorza@reddit
have you looked at https://www.fastht.ml/ ?
thecrypticcode@reddit
Maybe you have already come across Marimo for WASM notebooks.
United_Intention42@reddit (OP)
Marimo claims that notebooks can be deployed like app, but I doubt if deployed app will be scalable and user-friendly.
It's mosly for experiments.
My vision is to create Next.js for Python (Not same architecture).
thecrypticcode@reddit
I agree heavy computations with marimo WASM notebooks may not be feasible, as also stated in their documentation. At least I was able to embed a Marimo exported WASM notebook for demonstration of my python library into my sphinx documentation and it seems to work well for fairly expensive operations such as matrix inversions. I haven't tested extensively, but performance degradation while running in the browser was not considerable. Do you think/already know that with your strategy heavier computations will be possible in such a WebAssembly python instance?
United_Intention42@reddit (OP)
Not conclusively, yet. Because it’s Pyodide-based it inherits the same general WASM constraints, but once v1 is stable I’ll run targeted benchmarks on heavier workloads and compare against Marimo.
thecrypticcode@reddit
Looking forward to it! All the best.
rm-rf-rm@reddit
have you seen anvil.works ?
United_Intention42@reddit (OP)
Hey just checked out their website,
anvil.works is not an open Source framework and their free plan is so limited.
I want to give all devs power of web-dev in Python.
metaphorm@reddit
this is a cool experiment. go for it! at first glance the architecture makes sense to me.
United_Intention42@reddit (OP)
Thanks!
from evolve.router import routefromevolve.appimport start@ route("/")def Home():return div("Home")@ route("/counter")def Counter():count = signal(0)return div(h1(count), button("++", on_click=lambda: count.set(count()+1)))start(port=3000)I am planning to keep syntax something like this.
charlyAtWork2@reddit
I like the idea... will be curious to watch the hello world.
United_Intention42@reddit (OP)
Me too!
The very first page will say "Hello World".