Reflex – Web apps in pure Python
github.com
github.com
- you still use html and a templating language for the views
- it mostly looks like old ssr code but you can transparently call methods on the server (like meteorjs)
- you get one of the best ORMs in existence with great relationship handling and generated admins
https://www.django-unicorn.com/examples/search
Not 1.0 yet but I'm using it in production and omgosh is it easy to crank out UIs.
> Note that all examples are deliberately left unstyled to present the simplest implementation.
I've looked at too many documentation examples that show a bunch of things at once, with unrelated tech, making it hard to understand the current point.
Also check out https://laravel-livewire.com (PHP) and https://hotwired.dev (backend agnostic; there are implementations for Rails and Flask) and https://htmx.org
This kind of shit might catch a manager's eye, not a developer's one.
Github and hackernews are both places where developers exchange ideas, so it helps if you explain which tech you build on and what challenges you faced.
This is literally a link to the source code repo!
php didn't use openai IIRC
i kind of cannot imagine what this would use openai for unless it's using it to write a web application for you. which is pretty ...not like php.
I think its a decent example project, its easily readable and you can understand what they're doing, but I think as a general rule its better to do something without external unrelated libs. An AI image generator just seems a bit too specific of an example for something that fundamentally has nothing to do with AI.
[1] https://github.com/reflex-dev/reflex/blob/919f239168d789056d...
[2] https://github.com/reflex-dev/reflex/blob/919f239168d789056d...
It sends the information to a remote server, so your IP is obviously shared as well. It also sends a "project_hash" as "distinct_id" which sounds like a unique tracking ID to me.
https://nextjs.org/telemetry https://docs.streamlit.io/library/advanced-features/configur...
If we call things by their names, it's not surprising at all and actually makes solving the situation much easier.
man... the modern YC/VC webdev game is rough.
Of course, since it’s coming from Google, I suppose it shouldn’t have been quite so surprising.
Seriously tho, when one sees the first word of a Python project with the description "Performant", or a project put Out There by someone with a handle not linked to a bio (even a fake bio)...
Anyway, software regs ARE coming because The Way of software developers has not been obscured from public view for some time now and the (relatively) recent ransomware of municipalities and hospitals resulting in deaths along with serious tensions among global powers have made it a priority. How ironic is it that Microsoft is best positioned to play the gatekeeper role? https://noguiltlife.com/wp-content/uploads/2023/01/scie-fi-m...
Hacker News is for serious discussions only --wow, already up to 119 comments already at https://news.ycombinator.com/item?id=36967829
"My-iy-iy time don't loooose it."
Installing all the python deps (250mb), and node_modules (500mb) , plus a package size of 3mb of js isn't a great look.
The 3MB of JS is in dev mode or prod mode? (Is this similar to the other comment where they were running in dev mode but when they ran in prod it was much smaller ~ 340KB?)
I wish them the best with their hosting platform.
I'd go so far as to say the patterns are so clean they're almost self-evident, which is remarkable lift for beginners or busy people just mocking up something functional.
So now you have some serious talent looking at the pain points people express about the platform, because ofcourse you want to keep the "devlopers, devlopers, devlopers" happy.
Personally I dont see the attraction of an all python approach to the web. The event driven nature of client side programming has no particular affinity with Python. While JS is clearly a monopoly, it doesnt strike as we are paying a huge price for the lack of alternatives. Maybe its just my lack of imagination. If people complain about JS frameworks is because of the choices and designs and burdens these imply, not the fact they are JS.
The area where an all-Python approach would be a radical new take that opens entirely new horizons is actually not the web, but mobile apps.
What you can fix, though, is an ecosystem built on a pile of left-pad-quality hacks that change every other week. Hence the various attempts to jailbreak the accidental monopoly JS was born with.
Unfortunately, this project doesn't even try to do that, and still relies on that pile of hacks. As such, it's never going to be particularly popular - why suffer most of the JS-ecosystem pain plus the additional pain brought by a transpiler?
Sounds like a pitch that would make VCs start falling over eachother
Yes, and earlier it was crypto, and earlier, $foo_buzzword, and earlier, $bar_hypeword, and earlier, SAAS, and earlier, client-server, and ...
It's not really much of a stretch to understand why they got funding.
Vercel is synonymous with Next.js and JavaScript, not Python. Flask and Django also don't have full integration with React like Next.js (Because it's all JS) and Reflex (Feature of the framework) do.
The value prop is very clear to me. Next.js is extremely popular for good reason, I see a lot of value in bringing that to the Python ecosystem as well, especially with all the Python ML SDKs.
Lets compare this with for example play https://www.playframework.com/ I know from this that it built on Akka, its stateless, aims for predictable resource consumption, has non-blocking io, etc. There is a ton of really important information on what does this web framework actually do that is really important when you are making a choice of a framework.
I have no idea how good this framework is, but besides a few toy examples, I can't see anything that makes me thing "wow this is great I need to use this". Using python to generate front end attributes isn't new, most any web framework can do this also.
The others are the current latest version, python version we support, how many people are on our discord (A metric to see community activity), and a badge that points to our docs. I think all of these are important but open to suggestions on ones you think would serve a better purpose.
I expect tests to always be passing before merging anything.
pypi metadata has the list of supported python versions, in text format
A link to your documentation? Ok but why can't it be a regular link?
I use forums or IRC, so the online users on whatever aren't super meaningful to me personally.
We will look into this, I think the info is still important to show but there probably is a better more inclusive way of doing it.
What, specifically, is the issue with the badges concerning accessibility? Most badges I see can be reduced to a div containing two spans and some text, which should be usable with a screen reader. Is there missing alt text, aria attributes, etc?
Re: tests, it comes down to developer culture. It may be acceptable for experimental or alpha/beta versions to not pass tests, live on a separate branch, etc. Distros should be live-testing any packages they ship, too; upstream releases aren't guaranteed to be tested, depending on the upstream you're working with. It's nice to know that the latest commit is actually working without having to double check CI locally. However, tests also aren't created equally. The project author(s) could be learning how to refine their tests, and not actually trust the CI's results (yet).
Can we argue that's sloppy, or that they should've never done that before merging and pushing? Sure. Not sure where it gets us. Actionable feedback and cautionary advice is useful, though.
If a test is not working/outdated, remove or fix the test. It's not what the badge is showing anyway.
I was hoping there is some technical explanation how the compilation step works (especially what do they do to event handlers) but their documentation is very light on details.
You need to prefix the url, ie.
view-source:https://news.ycombinator.com/No offense, but the play framework docs are objectively worse, it feels very "enterprisey" and too many clicks (the "Hello World Tutorial" spans 3 pages)
Do we have benchmarks for this? More generally speaking, I don't see more technical differentiation besides it being a Python DSL. Nor do they provide numbers to back it up.
In general, I think the readme's not bad. I think the example is eye-catching, and I can imagine this would be really nice to make a prototype with. Whether or not it would scale well etc, yes, it would be good to have some of that detail. But I can see a really good use for it already.
I've used Anvil [0] quite often in the past years for what seems to be a similar purpose (not affiliated, just a happy customer). Does someone know how Reflex compares?
So yeah, full on pivot into python. pip install shiny. Alright!
"No web development skills required. Develop web apps entirely in R I mean Python"...yeah that's not happening.
I realize TypeScript may be doing the same thing but that somehow tastes OK because it was purpose built for the task. (Although I abhor cleverness in general).
Do you mean internally in the library? None of the sample code has any type annotations.
1. huge programmer pool 2. tried and tested legacy code could be easily used / adapted 3. code quality / checkstyle plugins just worked 4. great testing tools
My main gripe was the compile time (often 2-3 mins)...whereas Adobe Flex would crank code out in 3 seconds.
Now, the new language models should help us push through the noise.
There is no denying the importance and usefulness of web apps. You and me may be fine writing JS/TS, but many don’t want to. Why shouldn’t there be an option that works better for those folks?
People use either Java, PHP or NodeJs.
By and large "people" are not "displeased" by Python. But every language has a set of diehards, people who dedicated decades to this or that and resent adopting anything else. They will complain no matter what. Python is displacing a lot of other platforms in its continued rise, so the noise keeps going up.
In addition, there are groups of nerds that love to formalize absolutely everything in their code, development speed be damned; and people who will optimize every line they write to an inch of their life (again, dev speed be damned). Both those camps are often uneasy in an ecosystem built on duck-typing, "practicality beats purity", and an overall approach favouring development speed over machine speed.
Really, I think the main driver for isomorphic Python web libraries like this isn't general web apps (though they'll get used for that, too), but the putting frontends on data science, ML, etc., stuff where Python is the dominant tooling language.
Jupyter and Shiny seem adequate for that.
Which is why I'm a bit surprised that RPC/APIs still have as much overhead as they do, especially around types.
Tons of software exists for this reason. For example, somewhat relevant here, web apps in R via R Shiny: https://www.rstudio.com/products/shiny/
(There is also Shiny for Python IIRC.)
I'm in this camp.
For services that I'm building that are not heavily frontend reliant, I don't want to learn a whole new language and framework
There's a time and place for quick and dirty interfaces to kick off server-side code, which is what this feels like.
There is definitely that barrier to entry to have to write server side routes and html/js to interact with them.
And, while Phyton would not be my preferred choice for robotics, I did write kernels for small 'autonomous' mobile robotics a long time ago in C. The systems ran at 20 hz. I'm pretty confident modern embedded computers running Phyton can achieve 20 hz sense/think/act cycles.
Kind of a weird thing to say when the domain is web frontend where the default (which this wraps) is JS, another “scripting language”, to the extent that label actually means anything (which it mostly doesn’t.)
Completely ridiculous!
But it is more like Python bindings for React and supports multiple web frameworks (Django, FastAPI, etc.).
[0]: https://reactpy.dev/docs/index.html [1]: https://github.com/reactive-python/reactpy
Still not the fastest, but not the slowest at least.
I'd see this as more like Svelte (or at least the projects I'd usually build with Svelte I might consider this for instead).