Live data from Hacker News

Rio: Web apps in pure Python

github.com

161–170 of 205 posts

Re: Rio: Web apps in pure Python

#161
post #128

I've enjoyed working with Reflex ( https://reflex.dev ) as a pure Python wrapper over React.

react license applies then to products made with this stack? i.e. no product that meta thinks of as a competitor is allowed?

React is fully OSS as far as I know: https://github.com/facebook/react/blob/main/LICENSE

I think the term you mentioned was there at the start but has since been removed and React is licensed pure MIT since 2017.

Re: Rio: Web apps in pure Python

#163

Earlier quoted context omitted.

> because the tooling and patterns change almost daily. That is just plain wrong. And that comes from someone who stayed from web dev for the same reason. Nowadays it’s vite/esbuild and you’re good to go. And you don’t need any web framework to come up with basic ui. touch index.html; touch styles.css; python3 -m http.server And you’re good to go. > "I know a fair amount about computers, I want to write a web applica…

Last time I (kinda halfway / didn't) learned frontend it was react-create-app. Before that webpack. And before that grunt. You do not need a framework if you really know CSS and HTML5 well, but that is exactly "knowing the whole stack" - which was the parents point.

> Before that webpack. And before that grunt.

I do back end web development, but need to be able to build and run the whole thing locally. I've been through webpack, and grunt, and.. um.. something before that. And throughout it all, I have a make file that has targets for 'clean', 'build', 'NOTEST=true' (to prevent tests from running), etc... specifically because I find it super frustrating when we need to move from one build system to another, and trying to remember which one _this_ project is on, and how that one does each thing, etc.

So every time we add (switch to, but really add) a new build system, I update the Makefile to be able to build with that system, and then just use make to build everything and completely ignore what's doing the actual build :)

Re: Rio: Web apps in pure Python

#164

Earlier quoted context omitted.

I think my answer: I have no idea what multi-line lambdas are, probably explains why I find Reflex (or Rio/Streamlit, etc) amazing, haha For a person with zero front-end knowledge, it's a game changer.

In JavaScript you can do this: const f = (x, y) => { const z = x + y; const w = z * 2; return z - w + x; }; In Python, you cannot do this: f = ( lambda x, y: z = x + y; w = z * 2; return z - w + x; ) Instead, you need to pull it out into a def: def f(x, y): z = x + y; w = z * 2; return z - w + x; Sometimes, this is no big deal. But other times, it's damn annoying; the language forces you to lay out your code in a les…

Actually you can. If you really want a multi-line lambda with your example...

```f = lambda x, y: [ z := x + y, w := z 2, z - w + x, ][-1]```

* That version does look strange, as it uses a list in order to get that last calculation. But I often use lambdas to check results in parametrized tests, and they naturally spread to multiple lines without the list hack since they're chains of comparisons.

Re: Rio: Web apps in pure Python

#165
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")

Their goal is for their target developers not to have to learn html and css. Text and justify make a lot more sense to those whose layouting experience is mostly based on MS Word then span and text_align do.

Also, let's not pretend that html/css is particularly well designed or easy too learn. It's the backwards compatible result of decades of experimentation, where the initial design did not even remotely consider building interactive apps with it.

Modern web app dev requires learning way to much (archaic) stuff, just to create something that ought to be simple. Rio at least seems to be trying hard to address that.

Re: Rio: Web apps in pure Python

#166

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.

In general I'm not convinced that these "no Javacript" frameworks will last, and to some extend you going to have to re-learn a lot. That's not to say that the idea isn't interesting. While I have no idea how this would work, I think it would be more useful to have tools like this as a sort of template language for something like Django or Flask. So you get the mature frameworks on the backend and something like Rio…

Agreed. There are legitimate cases for using SPAs, but often CRUD will suffice.

Re: Rio: Web apps in pure Python

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

At yes lets use a screwdriver to do something which a hammer was meant for and call it progress. That is what I read when I read the title. People should think about what a language's purpose is before planning to interate a technological design around it. Python is very good for many things just not this...

What exactly makes Python (the language) not good for this? Keep in mind we now also have PyScript.

Re: Rio: Web apps in pure Python

#169

Earlier quoted context omitted.

> and purely due to a 10 day timing constraint put on him by Netscape management (right after their deal with Sun Microsystems), Brendan Eich, wanting a Java-syntax, but not having enough time to do it right, cobbled together JavaScript instead. Stop spreading FUD. You have no idea what you’re talking about. Stuff that people hate wasn’t even part of the original demo. https://buttondown.com/hillelwayne/archive/did-b…

I read that whole blog post and nothing in there disagrees with what I said.

Did you?

> Most of JavaScript's modern flaws are arguably not due to the short development time

Re: Rio: Web apps in pure Python

#170

Earlier quoted context omitted.

In JavaScript you can do this: const f = (x, y) => { const z = x + y; const w = z * 2; return z - w + x; }; In Python, you cannot do this: f = ( lambda x, y: z = x + y; w = z * 2; return z - w + x; ) Instead, you need to pull it out into a def: def f(x, y): z = x + y; w = z * 2; return z - w + x; Sometimes, this is no big deal. But other times, it's damn annoying; the language forces you to lay out your code in a les…

Actually you can . If you really want a multi-line lambda with your example... ```f = lambda x, y: [ z := x + y, w := z 2, z - w + x, ][-1]``` * That version does look strange, as it uses a list in order to get that last calculation. But I often use lambdas to check results in parametrized tests, and they naturally spread to multiple lines without the list hack since they're chains of comparisons.

That's pretty janky - I don't think it would pass review in many places!
Post reply on HN