HNHacker News
TopNewBestAskShowJobs

picklelo

492 karma · joined April 16, 2018

nikhil@reflex.dev
submissionscomments
picklelo··on Roast Your Website with Claude3
I was playing around this weekend on making user interfaces around Claude3 and built this little web app to roast your website.

Source code here: https://github.com/picklelo/webcritic

picklelo··on Designing a Pure Python Web Framework
Yes good call out. We started as Pynecone but a company with a similar name forced us to change our name.
picklelo··on Designing a Pure Python Web Framework
Hey thanks for the feedback. We're working on relaxing our dependencies [1] to make reflex more compatible. Do you remember what libraries you had the conflict with?

[1] https://github.com/reflex-dev/reflex/pull/2796

picklelo··on Designing a Pure Python Web Framework
Thanks! we found script-like frameworks like Streamlit are nice for small apps, but hard to reason about for larger apps. We went with a declarative approach more similar to React.

FastAPI has been working well for us, but we're not strongly coupled to it - in the future it would be easy to swap it out if needed.

picklelo··on Designing a Pure Python Web Framework
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

picklelo··on Designing a Pure Python Web Framework
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.

picklelo··on Pynecone – Performant, customizable web apps in pure Python
We want to support any UI feature that you can build with React/NextJS. We will expand our core to include components like rich text inputs but we also have a way to wrap any React library so you're not locked into the components we provide: https://pynecone.io/docs/advanced-guide/wrapping-react
picklelo··on Pynecone – Performant, customizable web apps in pure Python
Keeping the state on the server allows us to run arbitrary Python code and libraries in our event handlers that update the state. Currently only the ui is compiled to React but the logic stays in Python.

We’re working to offload more logic to the client in the for purely UI operations like you mention, and in the future want to leverage wasm once it’s more mature.

picklelo··on Pynecone – Performant, customizable web apps in pure Python
Thanks for pointing out, we will update our sqlalchemy dependency to the newest version
picklelo··on Pynecone – Performant, customizable web apps in pure Python
Yeah we’re only hosting on a single region at the moment so there can be latency depending on your location. We’re working on using edge computing to speed this up.
picklelo··on Pynecone – Performant, customizable web apps in pure Python
Cofounder of Pynecone here - thanks for the feedback. We’re prioritizing improving our docs and example apps in the upcoming weeks and will have a ChatGPT clone example. Definitely want to improve the onboarding experience and showcase these more complex use cases.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
The state is updated through Python functions that are run on the server, so the state needs to be on the server
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
We use Websockets for state interactions, so the latency may depend on your internet connection + distance to server. We will improve this in the future by leveraging more edge computing and WebAssembly to execute closer to / on the client.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
The ORM is a wrapper around SQLAlchemy, so only SQL databases for now. But since everything is in Python, you can still connect to any other database/service like you normally would.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
We're using Pydantic and our compiler has custom type-checking on top of Python to catch these issues.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
I'll look why the search doesn't bring it up - see our event chain example here for how we do async event handlers: https://pynecone.io/docs/state/events
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Only the frontend is compiled to JS/React. All the logic and state updates stay in Python and are run on the server, so we don't have to transpile arbitrary Python.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Our goal is for the user to never have to see JS. We try to catch most errors in Python during compile time. We're also not trying to reinvent things like CSS styles, just make them accessible in Python.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
We definitely will add these auth components to the core library
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
We use the `cloudpickle` library which supports most data types. We found the state size doesn't impact performance too much - our main website's state is quite large but the Redis loads stay fast.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Yes that sounds interesting, let's discuss more!
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Each new browser tab creates a new state. We use Redis to store the state and expire it after 30 minutes.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Thanks! We're using GH Projects for everything, we will update the board with a more long-term roadmap. Python support for wasm isn't where we need it yet, but we definitely want to integrate it when it's ready.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
I've used some of these in the past and they're easy to get started with, but I found limitations in terms of components, styling, and performance. Since we compile down to a NextJS app, we aim to have the flexibility of traditional webdev with the ergonomics of Python
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Yes, in Pynecone you write your frontend in Python and it's compiled to a SPA, plus a FastAPI backend server to handle state updates. Django and Flask handle the backend in Python, but you still have to use Javascript for the frontend.
picklelo··on Launch HN: Pynecone (YC W23) – Web Apps in Pure Python
Thanks! We're building a hosting service that you can deploy your apps to. Our plan is to have a free tier for your first app, then charge for additional apps. We're still finalizing this, so would love to hear any thoughts.
picklelo··on Summer Afternoon – A WebGL Experiment
This is awesome the graphics are very relaxing
picklelo··on Show HN: Pynecone – Web Apps in Pure Python
Yup, our frontend is just a wrapper around React so it is fully declarative. We are definitely more opinionated than something like Flask, but the benefit is that you can write your whole app, including the frontend, in a single language (for small apps just a single file).
picklelo··on Show HN: Pynecone – Web Apps in Pure Python
Thanks so much for your kind words! We think our approach can really simplify web development and make it accessible to a larger community. Excited to see what you build with it!
picklelo··on Show HN: Pynecone – Web Apps in Pure Python
Thanks so much! We're excited to have people start using it and are looking forward to any feedback :)
Page 1 of 2Next →