9 ms·
Reflex – Web apps in pure Python
- ammar_x 3y agoHow does it compare to Plotly Dash?
- pruthvishetty 3y agoHow is this different from Streamlit or Pynecone?
- jeron 3y agoWhy are we trying to fit a square peg into a round hole
- gostsamo 3y agobecause some people have a square peg and not a round one.
- dinkleberg 3y agoIsn’t the answer obvious? They want to! 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?
- toyg 3y agoJS got popular on the server because it was the default option on the client. Makes sense that Python should get popular on the client because it's the default option on the server.
- cjaybo 3y agoSince when is Python the “default choice” for server side dev?
- wheelerof4te 3y agoSince never. People use either Java, PHP or NodeJs.
- zzzeek 3y agoyou might want to let Instagram or Github know those are the three choices
- cosmojg 3y agoI don't know where you work, but at my company, I'm struggling to get people to use anything but Python.
- IshKebab 3y agoMe too, but we don't do web stuff so Python makes at least some sense. Even if it is generally pretty awful.
- tamimio 3y agoGood luck with that! I think using python for anything beyond a simple script or PoC, should be taken as a red flag in development and immediately revise that decision of using it.
- wheelerof4te 3y agoEverything but the Crab language is worthless fluff.
- sriram_malhar 3y agoTell that to Netflix, youtube, instagram, quora, Uber and others.
- dr_kiszonka 3y agoMaybe it is easier to learn a framework within the ecosystem of a language you already know than to learn both a framework and a new language. 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/ https://www.rstudio.com/products/shiny/ (There is also Shiny for Python IIRC.)
- lijok 3y ago> Maybe it is easier to learn a framework within the ecosystem of a language you already know than to learn both a framework and a new language. 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
- turtlebits 3y agoAgreed. 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.
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- tamimio 3y agoSome people are die hard python fans, trying to use a scripting language for everything. I encountered some where they try to use Python in embedded (robotics to be exact) and oh boy how terrible it was, a “collision avoidance” was taking few seconds to respond..
- PeterStuer 3y agoSome of us just need a simple webform for our project. Keeping all code in Python makes sense. Nearly all generative AI projects with a web frontend on Github use libraries like Streamlit etc. 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.
- dragonwriter 3y ago> Some people are die hard python fans, trying to use a scripting language for everything. 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.)
- bodge5000 3y agoWhy not? Someone has found a way to fit a square peg into a round hole, your round pegs still work the same as they did before, people just have more options now.
- cataflam 3y agoLooks nice! 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? [0] https://anvil.works/ https://anvil.works/
- haolez 3y agoI've looked into this recently and it's really good. They make use of Python's type annotations to do some clever conversions to frontend code.
- leetrout 3y ago"Clever" and "frontend" with Python honestly concerns me. 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).
- dragonwriter 3y ago> They make use of Python’s type annotations to do some clever conversions to frontend code Do you mean internally in the library? None of the sample code has any type annotations.
- ilrwbwrkhv 3y ago$5 million raised for hosting? I honestly fail to understand the ways of VC despite a decade of trying to understand them.
- lijok 3y agoHey, you know the most popular programming language in the world? They don't have a way to write web applications. If you fund us, we'll build a tool for that, tap into a huge TAM and make bank. Sounds like a pitch that would make VCs start falling over eachother
- paxys 3y agoClose, except throw "AI" in there a few dozen times. Even the example they use in the README is for calling the DALL-E API.
- conductr 3y agoThis one trick will 10x your preseed valuation
- fuzztester 3y ago>Close, except throw "AI" in there a few dozen times. Yes, and earlier it was crypto, and earlier, $foo_buzzword, and earlier, $bar_hypeword, and earlier, SAAS, and earlier, client-server, and ...
- jboy55 3y agoVC looking for an aquihire payout. I haven’t looked, but perhaps some of the team is ex-FAANG and the VC is counting on a purchase price > $5mil.
- rickette 3y agoDo aquihires go for that kind of money? I expect these to be much much lower.
- dxbydt 3y agosometimes the war is lost even before the battle begins. During grad school, I wrote a whole bunch of web apps entirely in R using Shiny. It was clunky as hell, but yeah, it worked. I went looking for what's up with Shiny these days and found this - https://shiny.posit.co/ https://shiny.posit.co/ 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.
- jsiva 3y agoCould be worded better but I would interpret it as "No web development skills required to start developing web apps entirely in R/Python". You're still expected to learn web development but within the context of an R/Python environment
- ecshafer 3y agoMy major complain here is that, as far as being a web framework there is precious little information here about the framework. How does this framework scale with multiple requests? What concurrency strategy is it using (threads, processes, actors, etc?). Is this opinionated (it doesn't seem so but it also doesn't say it isn't either). How does this work with popular libraries x,y,z. The full docs have a little bit more information, but not a ton. But mostly there are some cute toy examples and "built in python" and thats about it. Lets compare this with for example play https://www.playframework.com/ 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.
- drcongo 3y agoBut there's emojis on the readme!
- bombolo 3y agoThey even have that long bunch of meaningless badges to say that tests are passing or whatever!
- apetuskey 3y agoWe have 5 badges in total, and 1 of them to points to our integrations test passing. And the integration test do serve an important purpose in making sure we are compatible on multiple different os and don't make a change that would break WSL for example. More info here https://github.com/reflex-dev/reflex/tree/main/.github/workflows https://github.com/reflex-dev/reflex/tree/main/.github/workf... 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.
- jdoss 3y agoI have built three quick sites with Reflex and it is fantastic for a systems programmer like myself who has no interest in learning Javascript. The recent addition of supporting Tailwind CSS works well and makes it very easy for me to make not terrible looking frontends. Their discord is very helpful for questions and issues that I have raised on their GitHub are responded to quickly. I wish them the best with their hosting platform.
- boredemployee 3y agoCould you share your sites?
- brap 3y agoWhile I see the appeal of putting everything on the server (from a DX perspective), but it just seems so wasteful.
- ptx 3y agoWorth noting is that this framework has telemetry [1] enabled by default [2] which gathers and sends off various information about your system unless you explicitly disable it. [1] https://github.com/reflex-dev/reflex/blob/919f239168d789056dfca6c67a500637f3f0ab8e/reflex/utils/telemetry.py https://github.com/reflex-dev/reflex/blob/919f239168d789056d... [2] https://github.com/reflex-dev/reflex/blob/919f239168d789056dfca6c67a500637f3f0ab8e/reflex/config.py#L160 https://github.com/reflex-dev/reflex/blob/919f239168d789056d...
- gigatexal 3y agoThere’s nothing user identifiable here though. No ips, locations, etc. I guess they could get it from the reception though hmm
- bakugo 3y ago> No ips 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.
- adamrezich 3y agoI haven't kept up with web framework type things in awhile—how commonplace is this? from here it looks kind of insane.
- RockRobotRock 3y agoProbably semi-common in Node world.
- abdullahkhalids 3y agoI played with this yesterday. The counter demo app (two buttons and a number) transfers ~2.5MB compressed, which uncompresses to ~12MB. Completely ridiculous!
- apetuskey 3y agoHey are you running in dev mode or prod mode I just tried the counter in prod mode and it was 340.1 KB compressed?
- abdullahkhalids 3y agoI see, I was indeed running it in dev mode without realizing it. It's indeed much better that production mode is a much more reasonable size.
- apetuskey 3y agoYes, dev mode is just for developing/creating and has hot reloading enabled.
- PaulHoule 3y agoReminds me of some of the crazy stuff microsoft tried with ASP and ASP.NET back in the day that made it really hard to build applications in a disciplined way.
- matijash 3y agoI'm following Pynecone (now Reflex) from the start and liked the idea of building out an AST with Python and compiling that to a working web app (we're actually doing the same with https://wasp-lang.dev/ https://wasp-lang.dev/, only it's a DSL and an explicit compiler with JS interop).
- apetuskey 3y agoThanks! We are fans of wasp as well!!
- tamimio 3y agoI don’t think this is a good idea, playing with the components there’s like a whole second for the checkbox to change status.. I don’t think python is even a good tool for ML/AI either. Maybe to prototype a UI but to be used in the wild, I don’t think so.
- paxys 3y agoI haven't worked with Python in many years now. Do people not use Django or Flask anymore? What's the recommended web stack, and where does this one fit in?
- nighthawk454 3y agoThey're still good. The new one is FastAPI which is performant and supports concurrency, schema validation, and a few other modern nicities
- LtWorf 3y agoAnd finally with pydantic 2 it's no longer using the slowest library for schema validation that existed! Still not the fastest, but not the slowest at least.
- rajasimon 3y agoI second the FastAPI. But always I choose Django and if you throw HTMX in the mix not even Rails come close to what it can build.
- bodge5000 3y agoI still use Django, and I love it, but it can be a bit of a heavyweight framework. I wouldn't call it cumbersome, but I couldn't imagine using it to build a single page web app without a backend for example, it's just a bit overkill. 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).
- Terretta 3y agoA lot of diagnostic in this discussion so far misses how approachably straightforward the DSL (patterned Python) is. 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.
- shrimpx 3y agoBtw what's "patterned Python"?
- skratlo 3y agoWhy wouldn't it say nowhere (README, the website) what does it actually do and how? It's all marketing bullshit such as: Get up and running in seconds! Build web apps in minutes. Deploy with a single command. Build anything, faster. Create your whole app in a single language. Don't worry about writing APIs to connect your frontend and backend. This kind of shit might catch a manager's eye, not a developer's one.
- hot_gril 3y agoIt has a complete code example in the README. Looks pretty nice for the use case it's designed for.
- ximm 3y agoThat answers the "what does it actually do" part, but not the "how". 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.
- xmonkee 3y agoDude its pretty clear what it does just from scrolling down the readme. “Its just like php” if that helps you, but you can also write frontend state management and dynamic behavior right there in the “template”, all in Python.
- 3y ago
- bjornasm 3y agoInteresting how the reception seem to be different this time around compared to when they were called Pynecone. At least that is my recollection. I follow this project with interest, I don't understand all that "you shouldn't do x with y". Each to their own requirements, its great to have a choice.
- shrimpx 3y agoYeah HN loved Pynecone! [x] I wonder if the new name is landing poorly or tides are turning against this 'everything in Python' space. Or the "Launch HN" tag encourages positive feedback. [x] https://news.ycombinator.com/item?id=35136827 https://news.ycombinator.com/item?id=35136827
- snthpy 3y agoI was just going to ask how this compares to pynecone, lol. The rename should really be highlighted more prominently.
- pard68 3y agoThat seems like a very unergonomic API.
- fock 3y agousing PyQT nowadays a bit... and honestly that is a joy compared to these examples.
- deleted 3y ago[deleted]
- LispSporks22 3y agoI love this style of web development. I'll go to lengths to avoid doing anything {Java,Type}Script when building web applications. My last favorite was Seaside w/ Smalltalk – not quite the same thing as this project though (Seaside works mostly server side).
- worthless-trash 3y agoJust asking based on your handle / name, have you tried parenscript for your js ?
- turtlebits 3y agoMy only wish for this is that it didn't just cobble a bunch of existing web stuff together behind the scenes and put an python interface + code generator on it. Installing all the python deps (250mb), and node_modules (500mb) , plus a package size of 3mb of js isn't a great look.
- apetuskey 3y agoYeah I see your point it's definitely something we are going to try and reduce in the future. We wanted to give the users the ability to wrap external react components and leverage that ecosystem so there were trade off we had to make. 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?)
- intelVISA 3y agoWild timeline: for ref. a HTTP webserver in C would run you under 1mb, all-in, if TLS'sn't required.
- fuzztester 3y agoHeh, yes. See: https://acme.com/software/micro_httpd/ https://acme.com/software/micro_httpd/ from https://acme.com/ https://acme.com/ Also see: https://acme.com/software/mini_httpd/ https://acme.com/software/mini_httpd/
- PixyMisa 3y agoRedbean is 2.3mb including TLS, Lua, and SQLite, and the same binary runs on Windows, Mac, Linux, and Free/Net/OpenBSD.
- nologic01 3y agoAs as a meta comment the dynamics and interplay of language adoption and language evolution is quite fascinating. For whatever reason, a lot of people have learned Python in recent times. Whether the hype is data science, machine learning or AI, the number of users creates its own reality. 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.
- toyg 3y agoMobile is blocked by Google and Apple, that's all. You can't fix that. 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?
- deleted 3y ago[deleted]
- RyEgswuCsn 3y agoDo you support server pushes, e.g. periodic updates initiated by the server to update client UIs?
- kolanos 3y agoAnother project in this space is ReactPy (formerly IDOM). [0] [01] But it is more like Python bindings for React and supports multiple web frameworks (Django, FastAPI, etc.). [0]: https://reactpy.dev/docs/index.html https://reactpy.dev/docs/index.html [1]: https://github.com/reactive-python/reactpy https://github.com/reactive-python/reactpy
- bradrn 3y agoNot to be confused with Reflex, allowing web apps in pure Haskell: https://reflex-frp.org/ https://reflex-frp.org/
- audibahnbacks 3y ago[dead]
- fyenneyenn 3y ago[dead]
- no_wizard 3y agoI feel like everything is eventually going to go full circle back to Google Web Toolkit[0]. The original "write it all in X language" toolkit with compile to JavaScript functionality. [0]: https://www.gwtproject.org/overview.html https://www.gwtproject.org/overview.html
- Varriount 3y agoAny idea what/which websites are written using GWT?
- snodnipper 3y agoIt was Google Adwords that was the big one to my mind...with Ray Ryan (rjrjr) leading a lot of those efforts.
- snodnipper 3y agoI was a massive GWT fan - particularly because it played well with the Java ecosystem. 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.
- winrid 3y agoDjango + Unicorn has a similar goal except: - 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 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.
- rlayton2 3y agoI love this: > 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.
- VectorLock 3y agoThis is kind cool. Closer than the Reflex thing to what I think would be cool. I wonder if anybody has made any kind of Python/Django system that lets you just write the front-end stuff in React but handles all the state synchronization stuff between React and your Python server.
- winrid 3y agoThis is that, just using django templating language instead of JSX.
- shrimpx 3y agoThis is awesome. Also check out https://laravel-livewire.com https://laravel-livewire.com (PHP) and https://hotwired.dev https://hotwired.dev (backend agnostic; there are implementations for Rails and Flask) and https://htmx.org https://htmx.org