Live data from Hacker News

Rio: Web apps in pure Python

github.com

31–40 of 205 posts

Re: Rio: Web apps in pure Python

#31
post #12

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 engi…

It would be a lot easier if they didn't rename things. 'Text' becomes 'span' and 'justify' becomes 'text-align'. Unless there's more I'm missing, it looks like they've just added a layer of indirection.

    rio.Text(self.name, justify="left"),
Becomes:

   Dataset 1
I'd prefer:

    rio.Span(self.name, text_align="left")

Re: Rio: Web apps in pure Python

#32

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.

And you don't even need build systems for modern SPAs. You can write web components in plain JS, load JS and CSS with standard module imports. Use bare import specifiers with import maps. Things have gotten much simpler.

Re: Rio: Web apps in pure Python

#33
post #12

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 engi…

It would be a lot easier if they didn't rename things. 'Text' becomes 'span' and 'justify' becomes 'text-align'. Unless there's more I'm missing, it looks like they've just added a layer of indirection. rio.Text(self.name, justify="left"), Becomes: Dataset 1 I'd prefer: rio.Span(self.name, text_align="left")

We don't see ourselves as Python bindings for the web, but instead as a pythonic way to create apps. I understand that "span" has become a well known name amongst web developers, that's just not something most new developers understand.

Think of it like how Python has renamed a lot of things. What other languages call arrays, Python calls lists. HashTables are dicts, and so on. Python has faced a lot of resistance here from people that got used to the more technical names, but I think the popularity of the language speaks for itself. Easy to understand, meaningful names are a plus, not a downside :D

Re: Rio: Web apps in pure Python

#34
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.

Re: Rio: Web apps in pure Python

#35

Earlier quoted context omitted.

Is python actually executed in the browser or is there a cpython process running on the backend?

No, it needs a server to run. This can be a python process or nginx or anything that FastAPI supports, since this seems to be build on top of FastAPI

You nailed it.

Built-in components do as much work as possible directly on the client. Any Python code however runs on the server. This makes it dead-simple to e.g. connect to your database and also gives you the full power of real CPython, not just a cut-down WASM/transpiled version.

Re: Rio: Web apps in pure Python

#37

Earlier quoted context omitted.

It would be a lot easier if they didn't rename things. 'Text' becomes 'span' and 'justify' becomes 'text-align'. Unless there's more I'm missing, it looks like they've just added a layer of indirection. rio.Text(self.name, justify="left"), Becomes: Dataset 1 I'd prefer: rio.Span(self.name, text_align="left")

We don't see ourselves as Python bindings for the web, but instead as a pythonic way to create apps. I understand that "span" has become a well known name amongst web developers, that's just not something most new developers understand. Think of it like how Python has renamed a lot of things. What other languages call arrays, Python calls lists. HashTables are dicts, and so on. Python has faced a lot of resistance he…

> that's just not something most new developers understand.

That is just false if you ask me. Eventually you reach the limits of the API defined by a framework and users will have to reach out to HTML and CSS. And now is there not only a level of indirection, but also all of the existing documentation from the Web Platform cannot be applied.

I think there is validity for having a Python based system (instead of JS) that runs on the client to render standard HTML and CSS, but this goes beyond that and will just become an immense scope creep.

Re: Rio: Web apps in pure Python

#38
post #12

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 engi…

Not sure I agree. What makes the presentation layer of HTML/JS/CSS so different from Win32 of yore, which had VB? VB enabled a LOT of bespoke monstrosities, but it let you do things quickly and easily. We need something like that for the web. There will always be essential complexity in dealing with the client/server nature of web apps. But there's still a lot of incidental complexity that can be burned off.

> What makes the presentation layer of HTML/JS/CSS so different from Win32 of yore, which had VB?

From my experience: besides both Win32 and VB being from the same entity (Microsoft), which helps a lot, what we had basically were VB bindings for the underlying Win32 library.

This Rio project seems more analogous to a library that tries to do an abstraction on top of Win32, like wxWidgets or Java's AWT. They work but the end results always seem a bit "off".

And unlike Win32, web technologies are moving targets and any assumptions one makes may be wrong some browser updates down the line... and there's where the nightmare comes

Re: Rio: Web apps in pure Python

#39
post #12

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 engi…

Not sure I agree. What makes the presentation layer of HTML/JS/CSS so different from Win32 of yore, which had VB? VB enabled a LOT of bespoke monstrosities, but it let you do things quickly and easily. We need something like that for the web. There will always be essential complexity in dealing with the client/server nature of web apps. But there's still a lot of incidental complexity that can be burned off.

Because of the rendering features provided by HTML, CSS and JavaScript semantics.

That is why Flash became so loved by Web designers, allowing them to target a rendering surface, completely bypassing the browser.

Also why we are now having Flash's revenge with WebGL/WebGPU/WebAssembly.

However the "until you have to debug it" still applies, unless you ship the browser with the application, but that isn't something people usually do. /s

Post reply on HN