by BiteCode_dev · 3y ago · 0 comments
So I get the point of the project, I can see a mathematicians getting value out of this.
Still, I would advice against using this for anything else than a small project (in the current state):
- any action your perform means a round trip to the server. This is why the counter seems so slow. Everytime you click on increment, it goes through the entire internet, ask for +1, and get the answer, then update the page.
- easy things will be easy, but even the average things are going to be hard. Every time you will want something that is not provided out of the box, the workaround is going to be painful.
- you are coding with react, one of the most complicated framework there is, but with a layer of indirection turning it into a black box. You better hope everything goes well because I don't wish debugging that on anyone.
- the database layer is going to bite you if you start to get fancy. Guaranteed.
- if you need this, you probably can't assess security. So no way to know if your website is secured. In fact, you can pretty much bet it is not.
This means if you use it for something big, you will eventually hit some kind of a big wall. Or something kind of painful experience that will possibly harm the project.
But of course, if the alternative is to never having started the project in the first place, you should definitely go for it.
The deployment being a pain for most python dev, this alone will make your life way easier, and 99% of projects don't have more that a few requests per minutes and a couple of pages anyway.
Just know what you get into: this is a trade off, as everything in engineering, not a unicorn.
Also, this is the Y combinator, so I assume there is a bigger plan behind this.
Good luck to the creators though, anything that move the needle even is good to attempt.
> any action your perform means a round trip to the server. This is why the counter seems so slow. Everytime you click on increment, it goes through the entire internet, ask for +1, and get the answer, then update the page.
Seems inconsistent with OP's
> the frontend compiles down to a React/NextJS app, so from the end-user’s perspective it looks like any other website
The python functions are NOT executed on the frontend.
While it is possible to run Python on the browser, the typical solutions to do so has a lot of drawbacks:
- brython (https://brython.info/) doesn't work with pip, doesn't implement full python spec, and has very limited tooling. I never could find a use for it professionally.
- pyodide (https://pyodide.org/en/stable/) is very slow to load and execute. It's mostly (but very) useful for teaching.
Plus, pynecone would have to solve the complicated problem of finding out how to delimitate what's python on the server side and on the client side, which we don't see in the API (and would complicate things for their target customer, somebody with little web dev experience).
So the decision makes sense knowing their goals and constraints.
You just have to understand the price you pay for it: anything calling a python function will cost a roundtrip. You will have to write you app with that in mind, and don't expect miracles either.
I can see myself using the product when I need to hack something quickly that is a one page interactive program. Or for some one of my clients with quants, geographers and the likes, that often needs to make a small utility available but have only knowledge of basic python.
It also could be a good companion to tauri (https://tauri.app/) to create desktop app. To me that would be even more valuable to have finally an easy way to do a decent UI in python. Because QT, WX, GTK and Tkinter are not fun at all, and the web is an amazing platform.
I just hope they are not going to eventually lock you into their hosting solution. But given that it's on github and open source, I feel confident. Plus the doc is very good, which is a sure sign of good human beings presents in the team.
Sibling comment about Websockets perhaps more interesting explanation
But yes, it is a tradeoff and the abstractions underneath are leaky. It is not just React but NextJS and then the whole NodeJS ecosystem which is surely one of the most challenging ones.
That client/web part could have been tackled by writing a micro library in pure JS with no transpilers of any sort - and probably they might do it in future not sure how, but something like Brython[0] could be interesting.
Meaning your server-side app is not stateless? Is there an instance for every client?