Google Mesop: Build web apps in Python
github.com
github.com
https://github.com/google/mesop/blob/fa17bcdcd765adef4b3259e...
If you know Python and can run inference models on a colab then you can quickly whip up a demo UI with builtin components like chat with text and images. Arguably everyone is testing these apps so making them easy is cool for demo and prototyping.
For anything more than a demo you don't use this.
FWIU Blaze was rewritten as Bazel without the Omega scheduler integration?
gn wraps Ninja build to build Chromium and Fuschia: https://gn.googlesource.com/gn
BentoML already wins at model hosting in Python IMHO.
What limits this to demos?
IIRC there are a few ways to do ~ipywidgets with react patterns in notebooks, and then it's necessary to host notebooks for users with no online kernel, one kernel for all users (not safe), or a container/vm per user (Voila, JupyterHub, BinderHub, jupyter-repo2docker), or you can build a WASM app and host it statically (repo2jupyterlite,) so that users run their own code in their own browser.
Shared in a Show HN: by devs: https://news.ycombinator.com/item?id=40567327
Not that this isn't worthwhile or interesting
The correct approach would have been to have an event loop in every process handling 1 - however many clients for the server. Then async I/O functions can be done inside the app routes without potentially impacting the performance of every other client being processed. The software here seems to use Flask for the underlying server stuff (when running from Python.) But anyone whose tried to use flask for a web project before knows that its slow AF since it loads everything one after the other. When looking that up I think you can tweak the number of processes it uses but IMO: it's not the right approach.
What makes them delightful?
The Steve-Jobs-ification of marketing copy continues unabated.
you know, for these times when there is nothing under the table. not even legs*, I mean.
*as in, "this thing has legs".
as usual, the hacker news subset consisting of the echo chamber / hive mind / tech bosses' slave crowd, can't digest / handle comments like mine above, while at the same are fine with the comment in a similar vein by paulcole, to whom I just replied above.
long live discrimination on hacker news! hip! hip! horror!
I believe many of the repos in the @google GitHub org are people's personal projects (and hence not officially staffed/supported, as disclaimed). In the linked Show HN, the authors confirm it's a 20% side project.
I just wanted to point out that just because something is in the @google org, doesn't mean it should be thought of as Google <something>.
This idea sounds promising. Who knows... you might even get one of the tech giants interested! Some of them have a lot of business customers that could use something like this.
You must be the Oracle of Delphi. Now that would be a nice product name for a visual IDE.
If you don't know it then it might take a while.
> The only server-side framework implementing the strategy of progressive enhancement automatically
Is this still true?
https://news.ycombinator.com/item?id=40171125
Draw your conclusions of the level of support for this library.
When their jobs were moved to Munich there was a lot of discussion about how important they were, but something else stood out to me. One of the things they accomplished was taking over a year to make sure the monorepo can be upgraded to the latest version of python
As an outsider this definitely smells like an org creating work just to justify its budget. You have a single team of a handful of engineers doing the python upgrade work for tens of thousands of engineers. Doesn’t feel right out of the bat
I’m sure soon enough with the role moving they’ll find out if the team is needed at all
There was a lot of cat-herding.
I don’t really believe if I go to 500 Google owned websites I will find the exact same version of angular everywhere
the python team did not personally upgrade every line of code to work with a new python version, we made sure that the code could be upgraded and got the people maintaining each package to do the upgrade. (a missing piece of the puzzle is that every package, even mirrored third party code, has an official owner responsible for keeping it working within google).
what the python team needed to do was upgrade all the tooling (build system, linter, type checker, etc) to work with the new version, run large scale tests to see what would break in an upgrade, analyse the dependency graph to figure out what order packages needed to be fixed in (e.g. if numpy needed to be upgraded that would be super high priority because thousands of other packages depend on it, and we might even pitch in and help the team maintaining it with that if needed), and track the progress of the upgrades, communicating with teams whose code hadn't been upgraded so that they could prioritise the work.
sometimes we also needed to write automated refactorings to fix some basic code pattern that changed, e.g. if some very widely used library decided it was going to stop accepting numbers where it needed strings, and that the caller should do the conversion first, we would try to mechanically fix that across the codebase rather than make everyone do it themselves.
anyway, this is all to say that it was indeed a large and time consuming problem, and we were certainly not doing it because we had nothing better to do with our time.
> Build custom UIs without writing Javascript/CSS/HTML
Why? These three were built for the web and work flawlessly. I doubt that an abstraction built on top of these will result in faster development times.
The State Management guide[1] explains state and then explains the usage. If you know Python and want to build a UI with it you'll have to read the guides. The argument that having a familiar language simplies development doesn't stand here.
There are multiple projects now that allow you to build a UI in Python and it feels wrong to me. Who is it even intended for?
Where so you start? If you have decided on using Python for the UI you have a handful of libraries each with their own documentation. To get started you need to choose one and then read the guides.
If you decide to use HTML you have a whole lot more resources. I'd argue you'll be able to make a frontend faster using this approach.
I understand the hesitation because of the complexity associated with JS. Maybe you're thinking about bundlers and minifiers when you think about writing a frontend with JS.
But you don't need that. You can create amazing user experiences with a plain HTML, CSS and a JS file.
1. It is inconsistent [1]
2. It does not have many features that programmers love and other languages have.
3. It has a community that holds different values from what other programmers value themselves.
If people want to continue development in JavaScript, they can. But since JavaScript has a monopoly on the (fairly large) 'frontend development for the web' market, there will always be attempts to find an alternative.
2. What are the missing JavaScript features that could be useful for web development?
3. I don't understand what you mean by this.
Finding alternatives are great. My point is that JavaScript/HTML/CSS are great and it's worth learning them if you want to work on frontends.
[1] https://stackoverflow.com/questions/66947264/why-do-python-s...
I disagree on the using something like this to start making a UI. When you know that your project requires a complex frontend, you're better of starting with HTML.
So you use something like Dash, Streamlit, or this, which allows you to do everything in Python and put up something that looks reasonably professional but does not require a great deal of time or effort. Or get serious and do it in Flask or Django.
From your other comment: But you don't need that. You can create amazing user experiences with a plain HTML, CSS and a JS file.
What do you consider the best example material for that? The reason us Python programmers (many of whom are amateurs) are so leery of Javascript et al is because most commercial websites are so hideously complicated, and most of us are just not interested in front end stuff or we would have started out with Javascript in the first place.
I've said it before, what most Python programmers want for UI is something like Visual Basic used to do - just a simple canvas with a palette of standard UI components that can be thrown together like Lego and doesn't look like a complete mess.
Here are a few websites that have great UX and readable source code. For each, you can view source and understand how the page is structured, styled and made interactive:
- https://tour.gleam.run, interactive code tutorial
- https://sivers.com, ecommerce
- https://www.geoffreylitt.com, personal website
I enjoy doing this and have recreated a few projects that I liked by reading their source:
- https://sudoku-aj.netlify.app inspired by https://sudoku.com
- https://imgbar.pages.dev inspired by https://imgflip.com
- https://logo-lang.pages.dev inspired by https://www.transum.org/software/Logo
Web technologies are amazing. It's one thing to say that it's hard because you're not familiar with it and another that they are objectively bad. I disagree with the second statement.
If people want a drag and drop solution for building UIs that's great. I'm sure no-code solutions exist for that. Again, my disagreement is on the point that somehow building UIs with Python is better.
> Why? These three were built for the web and work flawlessly.
Because you are throwing a Web UI on something written in Python for other reasons, and don't want to add 3 additional languages to the mix to do that.