bityard
It's a bit sad that most of the comments here are negative. Most of them seem to be some variation of, "Nobody needs a tool like this, all you have to do is simply dedicate yourself to multiple years of writing corporate CRUD apps in both vanilla soul-crushing Javascript and web frameworks. You know, like I did."

So, I am the target audience of this. I have a LOT of experience writing tools and automation and that is where most of my Python knowledge comes from. I am not an expert Python programmer, but I am competent.

But sometimes, I have an idea for writing a web application that would greatly improve my day-to-day life in some way. I know exactly what I want it to do, I know exactly what I want it to look like. I have already designed the API in my head, and could probably write the bulk of the Flask code in under an hour. Maybe a couple of hours if you want tests. But what I DON'T have is the time to learn is the vagaries of HTML+CSS layout and internalize the Great Lessons of the last 20 years of JS development history.

I have consciously stayed away from (non-trivial) web development because the tooling and patterns change almost daily. But the old stuff is not replaced, it is simply bolted on top of. And you have to know the WHOLE stack in order to troubleshoot most any part of it. Waking up one morning and saying, "I know a fair amount about computers, I want to write a web application," is just about as fanciful as saying, "I know a fair amount about airplanes, I want to design a jet engine."

Rio devs, thank you for releasing this as open source. I look forward to checking it out. Even if it doesn't pan out for me, I appreciate that you took a crack at it.

red_hare
These frameworks are cute, and I understand the desire to avoid the modern SPA JavaScript build systems, but it always seems like so much more work than just writing HTML.

I swear, HTML/CSS + Flask + HTMX gets you so far these days. Then, you can throw in some AlpineJS for any inter-element interaction you need and build a responsive SPA without almost any JavaScript.

maipen
Every framework, requires a learning curve.

You need to spend time learning how it works, what are it's limitations and what not.

The newer it is, the fewer components, help and support you have at your dispose.

I don't like these frameworks because it tempts people to learn something that isn't going to get mainstream adoption.

We already have to be careful when choosing a framework like React, vue, svelte etc...

Are you building a side project? You probably should just do it with what you already know, it's gonna be faster and probably better.

Not saying we shouldn't try new things or build new ways of doing stuff, but in this case you are not really running your python code on the web, your running compiled js,html and css...

I much rather choose something that allows me to write vanilla js with some extra features like signals.

gmaster1440
I've enjoyed working with Reflex (https://reflex.dev) as a pure Python wrapper over React.
mike_hearn
Another rather unconventional way to do this, though it can be powerful, is to combine GraalPython, JavaFX and jpro.one:

https://www.jpro.one

The primary advantage is that the built in set of components is pretty powerful (e.g. a real table view), everything runs server side, the Python can be JIT compiled, and from the user's POV it still feels like a web app (e.g. zoom is respected). You can "shell out" to Javascript if needed, you can use Java libraries. The JPro website is itself a JavaFX app running as a web app. Also there's a visual UI builder that's decent (and free).

Primary downside beyond just the obscurity of the stack (same problem as for Rio), is just that JPro is a commercial solution. But then you get commercial support and bug fixes in case you need something special or hit an obscure rendering case.

DannyPage
I love Python, but I also love building web apps in the native language of JS/HTML/CSS. Often times these "build the web in X" solutions are amalgamating that language into code that looks almost like HTML or JS, just with a Python flavor. I would love to hear from someone who used to do full-stack and now has moved mostly into a solution like Rio?
montebicyclelo
Nice, I guess a more established framework for writing webapps in Python is Streamlit, which is pretty good - minimal syntax can create quite an advanced, "reactive", GUI. It's very quick to throw together functional / relatively complex stuff with. But it's also very opinionated, so all Streamlit apps tend to have a similar look. Also it's more aimed at ML demos, for a few, non-persistent users, rather than for large apps with persistant users, etc. Wonder how this compares.
abdullahkhalids
How difficult is it to add authentication in this framework? How many lines of code? How secure?

None of the python->web projects have this.

davepeck
I'm excited to see more projects like Rio exploring the full-stack python web dev space. There are definitely categories of users for which the approach makes sense.

---

For me personally -- and I'm guessing for a bunch of other HNers -- writing full-stack web apps strictly in python is a non-goal.

I've settled on a comfortable (for me) stack for smaller projects that need python on the backend that combines:

1. Litestar (or another lightweight HTTP framework of choice like flask, etc.)

2. HTMX

3. htpy.dev (an in-python HTML builder)

4. Custom web components implemented in a plain-old JavaScript ES6 module loaded directly by the browser

A typical project only needs a handful of components. HTMX and htpy.dev both play very nicely with web components.

When I want zero build steps, I write plain JavaScript + JSDoc comments. JSDoc is... okay-ish, but it ain't no typescript.

If I need a database, I'll grab SQLAlchemy. I wish there were a mature lightweight solution here; maybe Tortoise ORM will get there soon?

There's nothing in this stack that couldn't strictly be done in javascript-land. JSX syntax with HTMX is pretty great and much better than any in-python HTML builder. But often my projects have other requirements (like ML) where python is, at least today, inevitable.

8organicbits
Looks like htpy, but with some components and a different syntax?

https://htpy.dev/

ag_rin
I feel like you’re getting a lot of pushback on this and I’m going to go out and say this is cool and I’m glad people continue to try to innovate on the webdev experience.

The way I see it is building apps somewhat similarly to SwiftUI is actually a pretty good idea. If you have established rules for how each container expands or fills its content you can build a great web app development experience without getting down into css and html explicitly. Just Vbox container Hbox container text container etc. I can certainly see a niche for this as it is a different style of UI development.

I’ve never been great as a UI designer so doing it in the traditional web stack has always been even harder but I’ve found that with SwiftUI I can usually get 90% of a good look very quickly.

Sai_Praneeth
Nice! How does it compare to https://fastht.ml/
pjmlp
This kind "you don't need JavaScript, HTML and CSS" approach always fails flat.

We already went down this route several times since the first dotcom wave and all the frameworks that tried to target the browser as if we don't need to know "JavaScript, HTML and CSS".

Until we need to debug the application, or why it isn't rendering as it should.

It is also why I am not a big fan of Blazor, even though I admire its engineering effort.

fmnxl
You'd need to re-invent the wheel on so many things.

Flexbox layout? CSS animations? Some custom npm library that I need to use to provide social logins, SDKs to integrate payment gateways? etc etc

If all you want is just a set of UI components, sure. We already have plenty of UI libraries out there.

These days there are many better ways to write low-JS, low-boilerplate code. HTMX for interactivity, UnoCSS for generated CSS on the fly. It's even possible not to bundle your ES6 modules these days, with <script type="importmap">.

weakfish
I would hesitate to label anything Python as “type-safe” per the README - maybe type-conscious or just “typed Python”
surfingdino
It's amazing how much you can build without resorting to those fancy frameworks if you dedicate some time to learning Django and how its views work. You do not need a SPA, you need a working app that looks good.
atum47
Is it the run_in_window() method cross platform? Can you talk a bit more about the implementation?
bnchrch
While I'm not certain if the world needs more Javascript,

I am certain it does not need more Python.

kitkat_new
I probably don't want to know about the performance implications
darepublic
To be fair a lot of small startups could benefit from forgoing custom CSS styles for very straightforward frontend dev. So much money wasted on react devs imho (including myself)
babyyoda
When building a full fledged web app I prefer JavaScript - when I do want to do more in Python I find Streamlit is a perfect fit for Python native, low code, but not trying to do too much
ZeroCool2u
This looks almost identical to Dash. Any meaningful difference here? https://dash.plotly.com/
joshdavham
Looks cool! But I'm wondering who the target audience is. Most web devs prefer javascript. Are you hoping to target data scientists to build data apps, for example?
3l3ktr4
Curious to know what you're using under the hood for the python! I've download the repo and a quick search with "pyodide" didn't return anything.
quantadev
The biggest tragedy in the history of software engineering was back in the mid 1990s when they failed to get Java (Applets) to run in the browser so they had to invent JavaScript, which was purely nothing but a hack put together over a weekend by one guy and it "stuck" like napalm onto humanity and has been burning us ever since. I would say at least one billion man hours (100 billion? Trillion?) has been wasted trying to contend with all the ugliness that ensued. Even the most popular language today on the web TypeScript only has one reason for existing: To try to continue to work around this napalm fire, in some semblance of a tolerable way.

Sure I love TypeScript, and use it every day, because it's the best solution to the current dumpster fire, but I'd like to get away from dumpsters some day. So it's really refreshing to see something good being done to replace this mess we call "Web Development"

miso2024
I have always been using Gradio, and it still comes short when it comes to slick UI, even with themes. So it is nice to see solutions like this that has a slicker UI.
somesun
there are maybe 50 web framework / app builder in python

just like there are new frameworks everyday in javascript

igtztorrero
Good for python developers without JavaScript knowledge, but your app will be attached to a fixed same graphic style.
insane_dreamer
I love a framework that replaces JS with Python. I'm less certain about replacing HTML/CSS with Python?
fsndz
I will start using this once a startup raises millions in VC funding and their whole app is built with this.
pmarreck
Are there any other frameworks that have similar ideas, perhaps using a functional language?
senko
I am definitely target audience for this.

I am often in need of building internal tools, dashboards - simple apps with simple UI that doesn't need to be unique, drive engagement, or whatever. It needs to get the job done and let me move on.

Streamlit is close but the peculiar approach they take (rerun the script) makes it unwieldly for more complex apps (say, a few related pages, a few dozen components each).

I've been looking for a way to just let me do "GUI app in Python" that get delivered over HTTP and rendered in browser, and Rio is exactly what I was hoping for.

Yeah, no chance Meta will rewrite FB frontend to use Rio. Also pretty sure that I won't be doing any fancy websites in it. But if I can skip dealing with React/Vue/HTMX/whatever on the frontend for some internal thingy.

I only tried doing some simple stuff but so far I really like what I see!

chirau
Is the rio.dev website built with Rio?
meehai
how does this compare to streamlit ?
adrianpluis
Nice work! Joined the discord
tambourine_man
Why the name Rio? Couldn't find in the docs
marcelr
so, uh, how does this work?

liveview kinda deal? python to js compiler? something else?

it drives me nuts when this isn’t in the readme, or from what i can find the docs

this is a major implementation detail that will determine the usecases for apps written in rio