Live data from Hacker News

Show HN: Mesop – Open-source Python UI framework

google.github.io

21–30 of 56 posts

Re: Show HN: Mesop – Open-source Python UI framework

#21
post #16

How does it compare to https://nicegui.io/ ? How does it compare with https://flet.dev/ ? Does it compete in the niche of making simple things easy and hard things possible?

Yeah, I think the "simple things easy and hard things possible" is a good way of framing this. I've written a blog post about the design philosophy of Mesop and how it differentiates with existing frameworks: https://google.github.io/mesop/blog/2024/05/13/why-mesop/

Re: flet - flet intentionally takes a more imperative approach whereas Mesop embraces a declarative UI approach (as popularized by React, et al). I think the declarative UI approach scales better as apps get more complex, but I think the best way to see the difference is to look at some of the examples and see which approach you like more.

Re: nicegui - at the high level, there's definitely some similarities with the component-centric UI model. The data binding/state management works quite a bit differently and Mesop's approach provides stronger type-safety and, IMO, is more Pythonic, but that said, there's a lot of good options in this space and I think it's neat to look at all the innovation that's happening here, and ultimately, some of this is based on aesthetics and how you like to code your UIs.

Re: Show HN: Mesop – Open-source Python UI framework

#22

Will you guys ever just do Python -> WASM? I think the next "Big break" for front-end web dev is literally this. I've been using Microsoft's Blazor (C#) which is this, with a mix of back-end and front-end capabilities, and I just don't see any reason to ever use JS or React again.

This is definitely something we've discussed and I think Python -> WASM is an exciting innovation. Right now, there's some challenges with how large of a WASM binary a typical Python app will compile to (e.g. bundling the std lib) and the initialization time [1].

I think supporting Python -> WASM could be one of the options we support, but there's probably always a need to support Python on the server, simply due to the ecosystem (e.g. dependencies) that's around it.

[1] https://pyodide.org/en/stable/project/roadmap.html#reducing-...

Re: Show HN: Mesop – Open-source Python UI framework

#23

My standing question is "How do you handle accessibility"? Are the resulting apps accessible by default for people with screen readers? About peoplewith other disabilities?

Accessibility is important and the good thing is Mesop is built on Angular Material components (https://material.angular.io/components/) which has invested in supporting a11y. Mesop components are likely missing aria-* attributes, but it's pretty easy for us to add them (essentially plumbing them from Python into the Angular components), so please file an issue on our GitHub repo to let us know what we're missing, thanks!

Re: Show HN: Mesop – Open-source Python UI framework

#25

I've had a quick look through the docs/demos. At the moment I use Flask/htmx/tailwind for my apps, but I like how succinct this framework is, but how themable is it?

You can customize the UI quite extensively using our Style API https://google.github.io/mesop/components/style/

If you like tailwind, I think you will like this as it's essentially like writing inline styles, but with a Pythonic, strongly-typed API.

Re: Show HN: Mesop – Open-source Python UI framework

#26

Glad to see Google employee still has 20% of their time to do side projects! Python UI is especially interesting for ML/LLM folks who can build demos without changing tech stack. I appreciate OP's ideas about how this project is compared to Streamlit?

Thanks for the question! Streamlit is definitely more mature and I think it's a great tool for many use cases.

Where I think Mesop shines is that you get a lot of flexibility, just by writing your UI in Python. For example, Mesop has an out-of-the-box [chat component](https://google.github.io/mesop/demo/), but if you need to customize it, you can actually just copy the [chat.py file](https://github.com/google/mesop/blob/main/mesop/labs/chat.py) and customize it however you want.

In comparison, Streamlit is great to get started with, but once you're trying to do some complex customizations, you'll often need to write your own React/TypeScript component.

I think the other thing is that Mesop has a [different philosophy for building UIs](https://google.github.io/mesop/blog/2024/05/13/why-mesop/) (e.g. based on functions) which results in a distinctly different developer experience. This is, of course, subjective, but I think the Mesop approach scales well as your app grows (e.g. thousands of lines), which even internal tools and demos oftentimes do.

Re: Show HN: Mesop – Open-source Python UI framework

#27

I've seen a bunch of people recommending alternatives that are also Python based, makes me wonder if there's similar things for other languages like Go, Rust, etc

There's similar things in other languages like https://www.gpui.rs/ and https://github.com/linebender/xilem.

Mesop also drew inspiration from frameworks like LiveView (for Elixir/Phoenix) https://hexdocs.pm/phoenix_live_view/welcome.html which have demonstrated the viability of building server-driven web UIs for a number of years now.

Re: Show HN: Mesop – Open-source Python UI framework

#28

My standing question is "How do you handle accessibility"? Are the resulting apps accessible by default for people with screen readers? About peoplewith other disabilities?

Accessibility is important and the good thing is Mesop is built on Angular Material components ( https://material.angular.io/components/ ) which has invested in supporting a11y. Mesop components are likely missing aria-* attributes, but it's pretty easy for us to add them (essentially plumbing them from Python into the Angular components), so please file an issue on our GitHub repo to let us know what we're missing,…

At a first glance at the demo gallery, nothing there is labeled as a button except for some in the embedded frame. The buttons there does not have an accessible label though. Nothing is list or grid, on the page and when any of the demo buttons are pressed, the focus is not moved to the new content. So, aria-role and aria-label as a start, I think.

Re: Show HN: Mesop – Open-source Python UI framework

#29

Earlier quoted context omitted.

Accessibility is important and the good thing is Mesop is built on Angular Material components ( https://material.angular.io/components/ ) which has invested in supporting a11y. Mesop components are likely missing aria-* attributes, but it's pretty easy for us to add them (essentially plumbing them from Python into the Angular components), so please file an issue on our GitHub repo to let us know what we're missing,…

At a first glance at the demo gallery, nothing there is labeled as a button except for some in the embedded frame. The buttons there does not have an accessible label though. Nothing is list or grid, on the page and when any of the demo buttons are pressed, the focus is not moved to the new content. So, aria-role and aria-label as a start, I think.

Thanks, I've filed an issue: https://github.com/google/mesop/issues/359
Post reply on HN