News for hackers. Stuff that matters.
Re:Introducing PyScript (summary of PyCon keynote) by raverbashing on Thursday June 23, 2022 @03:55AM (#31846251)
Developer time is still more expensive than 'runtime'

Talking about optimizing a range(10) loop was valid in the 90's, not today

Yes, CPython could be better, but there's Pypy. And still, CPython runs circles around the optimized Dart example you gave.

"pay a little attention to performance" cool, are we going to take all the crap out of JS that makes it inefficient?

"pay a little attention to performance" sounds to me like you're a fan of those C compilers that break code on purpose because the developer forgot some arcane detail. To what I call BS

Re:Introducing PyScript (summary of PyCon keynote) by codedokode on Thursday June 23, 2022 @04:40AM (#31846501)
Obviously, one loop in Python won't hurt performance. But reality is that people will try to build SPA on this technology. They will port Redux, that uses immutable objects and recreates whole graph of objects on every event. They will try to move SQLAlchemy and Django into the browser. Isn't it cool (for inexperienced developer), you just import a script from CDN and can write Django code? And this will run on a 10-megabytes interpreter in WASM.

Of course if you are writing an internal app and can provide M2 MacBook to every employee, then it is totally fine. But if you are writing applications for wide audience, it is a different thing.

I remember that one of early users of Vkontakte (a Russian clone of Facebook) was impressed that the site was loading fast on his old computer. As I remember, its JS code was written in vanilla JS without libraries like jQuery. Today the hardware is better, but if you will run SQLAlchemy in a browser to save development cost, your site's loading time won't impress users.

Re:Introducing PyScript (summary of PyCon keynote) by toyg on Thursday June 23, 2022 @07:49AM (#31847735)
There is absolutely no requirement or indication that Python UI framework will have to follow the same principles as JS ones.

> your site's loading time won't impress users.

Anybody who used client-server apps in the 80s and 90s is not impressed by browser-based apps either. Those expectations can be managed in so many ways.

Re:Introducing PyScript (summary of PyCon keynote) by raverbashing on Thursday June 23, 2022 @05:05AM (#31846622)
> They will try to move SQLAlchemy and Django into the browser.

Yes that will be a complete non starter!

I'm all for fighting inefficiencies and slow code, but fixing things like this, or Redux etc go much further than a simple for i in range() loop in Python

Re:Introducing PyScript (summary of PyCon keynote) by Panzer04 on Thursday June 23, 2022 @04:27AM (#31846432)
True, but there are limits. It’s surprising how many apps and webpages I use that are just straight up slow - things that should load instantly instead take a second or two. The web is a good application for this to some extent since there are other latencies that make this less noticeable, but they still exist.

Anything written to be performant is immediately noticeable - things just happen when you click a button. Dev time > runtime, but I’d argue some runtimes are so slow they begin to eat into user time too.

Re:Introducing PyScript (summary of PyCon keynote) by codedokode on Thursday June 23, 2022 @04:43AM (#31846518)
I notice this too. If I open a SPA there almost always will be a spinning circle and I have to wait like 3 or more seconds before I can see the content. In theory one can write a SPA that would load instantly, but in reality it will be a spinning circle.

I can only imagine how many people will just close the tab and move to next search result.