Live data from Hacker News

Rio: Web apps in pure Python

github.com

71–80 of 205 posts

Re: Rio: Web apps in pure Python

#71
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…

Back when I started programming, building programs with GUI was a breeze. Whether it was using Delphi, VB and WinForms, later .NET, or whatever - it was so easy that even complete beginners could get the hang of it.

At least for me, there's some nostalgia involved. The longing of "simple" - at least for smaller apps / software. Being able to slap together some simple app in 15 minutes.

Re: Rio: Web apps in pure Python

#72

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…

Python lists aren’t arrays, right? They are the closest thing in Python to an array maybe, but they do a ton of stuff under the hood, like grow when needed.

Calling them arrays would be very confusing to everybody who expects a typical array: a pointer with some empty space after it.

Re: Rio: Web apps in pure Python

#73

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…

A list is not an array. Each item is a pointer to what could be any type. There’s an array module if that’s what is needed.

Re: Rio: Web apps in pure Python

#74
post #50

While I'm not certain if the world needs more Javascript, I am certain it does not need more Python.

That's overly harsh IMO.

Python is not perfect—no language is—but it arguably has the lowest barrier to entry for new programmers, with far fewer "wats" than languages of its kind and era (certainly less than JS). Sure, its reference implementation is not the most performant, but it easily interoperates with C/C++, and alternative implementations like PyPy are also relatively easy to switch to, so it can be performant when it needs to. Dynamic typing is not great for maintaining large codebases, but with the advent of gradual typing, this shouldn't be a major hindrance anymore. It has a great standard library, and a huge ecosystem. My only major gripe with it is the packaging and the insane amount of tooling around it, which I doubt will ever be resolved at this point. But Python is not so bad overall.

Re: Rio: Web apps in pure Python

#76

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. Lite…

Where’s a good place to learn about the web components aspect? I’ve tried a few times (and the shoelace docs) but it doesn’t stick.

Re: Rio: Web apps in pure Python

#77
post #65

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

I spend 95% of my work time doing backend python microservices for internal tools, 5% on terraform for the infrastructure, and 0.0001% of my time building frontends for these tools (I just use plain html and JS, and only add a frontend when absolutely necessary). I've build a react app for fun in the past just to learn how that works but if I had to do it again for work I would basically have to go through the entire learning process again.

So, something like this where I'm writing pure python for my web components could really save me a lot of that churn time, not to mention that many of my coworkers have absolutely no JS experience. I have an upcoming task to build a new frontend and am going to add in a couple days to try this out to see if it meets our needs.

Re: Rio: Web apps in pure Python

#78

Earlier quoted context omitted.

+1 for Reflex. Truly amazing.

How is it writing React without multi-line lambdas? They are everywhere in JavaScript and I couldn't imagine my day-to-day without them!

Either name them, or squeeze multiple expressions into a tuple. More can be done, now with walrus.

Re: Rio: Web apps in pure Python

#79

Earlier quoted context omitted.

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…

Python lists aren’t arrays, right? They are the closest thing in Python to an array maybe, but they do a ton of stuff under the hood, like grow when needed. Calling them arrays would be very confusing to everybody who expects a typical array: a pointer with some empty space after it.

Yeah and no? Python Lists indeed don't make any sort of array-like guarantee, but they're implemented as a vector/autogrowing-array of python object references (but these objects are not guaranteed to be cache-local).

The implementation defines the underlying data structure as PyObject *ob_item

Re: Rio: Web apps in pure Python

#80
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…

IMO you either need to go all in or not at all. And by all in I mean your "web page" is nothing but a tag and your non-web framework is handling basically everything. It's an unholy nightmare for many reasons but it would at least allow you to make a reliable self-contained system.

"We'll take your native constructs and jimmy them into some bastardized HTML" is almost always full of razor-sharp edge cases.

Post reply on HN