Live data from Hacker News

Designing a Pure Python Web Framework

reflex.dev

1–10 of 59 posts

Re: Designing a Pure Python Web Framework

#3
I really like this idea of using Python to create both the frontend and backend. Another lib doing this is https://solara.dev/ . Something I particularly like about Solara is that you can interactively build your app in a Jupyter Notebook, since behind the scenes it's using ipywidgets.

Has anyone compared Solara and Reflex and can comment on pros/cons? Are there other options in this space? Maybe https://shiny.posit.co/py/ ?

Re: Designing a Pure Python Web Framework

#4
Anvil [1] is another "pure Python web framework", where you write both the client and the server code using Python. (The client code gets converted to JavaScript so that it can run in the browser.) Anvil has been around since 2016 [2].

[1] https://anvil.works/docs/app-architecture

[2] https://anvil.works/blog/page/15.html

Re: Designing a Pure Python Web Framework

#5

Can you call it pure python if it compiles to React? Seems like the abstraction just makes it harder to debug

We need to compile down to React/HTML in the end as it's the only way to render a webpage. By "pure Python" we meant from the developer's perspective they won't have to touch React or Javascript.

We only use React for the UI layer and to send events. Since all the state/logic is kept in Python you won't see Javascript errors during runtime, and debugging can mostly be done in Python land.

Re: Designing a Pure Python Web Framework

#6

Can you call it pure python if it compiles to React? Seems like the abstraction just makes it harder to debug

All programming is abstractions, unless you're using machine code. Abstractions don't necessarily make debugging harder -- done the right way, they can make it easier.

(Yes, you can call it "pure python" if it compiles to something else, because every programming language compiles to something else.)

Re: Designing a Pure Python Web Framework

#7
post #4

Anvil [1] is another "pure Python web framework", where you write both the client and the server code using Python. (The client code gets converted to JavaScript so that it can run in the browser.) Anvil has been around since 2016 [2]. [1] https://anvil.works/docs/app-architecture [2] https://anvil.works/blog/page/15.html

Doesn't Anvil force you to run stuff on their proprietary service however -- which costs money? (I'm not saying that's not a good option for some people, but it's very different to an open source framework you can run anywhere.)

Re: Designing a Pure Python Web Framework

#8
post #3

I really like this idea of using Python to create both the frontend and backend. Another lib doing this is https://solara.dev/ . Something I particularly like about Solara is that you can interactively build your app in a Jupyter Notebook, since behind the scenes it's using ipywidgets. Has anyone compared Solara and Reflex and can comment on pros/cons? Are there other options in this space? Maybe https://shiny.posit.…

Right now Reflex is meant for full-stack apps, but portability is something people have asked us for.

We're working on making Reflex work in different environments like Jupyter notebooks, and we're also exploring using Reflex for widgets [1] that can be embedded in pre-existing apps, so you can add interactive Python elements easily without rewriting your whole app.

[1] https://x.com/nikhi1rao/status/1767756284751991035

Re: Designing a Pure Python Web Framework

#9
post #7
post #4

Anvil [1] is another "pure Python web framework", where you write both the client and the server code using Python. (The client code gets converted to JavaScript so that it can run in the browser.) Anvil has been around since 2016 [2]. [1] https://anvil.works/docs/app-architecture [2] https://anvil.works/blog/page/15.html

Doesn't Anvil force you to run stuff on their proprietary service however -- which costs money? (I'm not saying that's not a good option for some people, but it's very different to an open source framework you can run anywhere.)

"The runtime engine that powers Anvil’s app hosting is open source. This means you can host your app anywhere..."

Source: https://anvil.works/open-source

Post reply on HN