-
Notifications
You must be signed in to change notification settings - Fork 1
Thoughts
theRealProHacker edited this page Feb 22, 2023
·
2 revisions
- Most of the work is done in C: IO, graphics, and calculations
- Asynchronous programming
- There is a conflict between confirmacy to the Web Standards and practicality.
- We try to implement everything as close to the standards as possible,
- But we don't implement deprecated features or features that are not implemented by most mainstream browsers.
- If the standards are ridiculous in some aspects, we go our own way, unless someone finds a good reason not to.
- We don't implement JavaScript, and we don't need to feel forced to even follow the standards for JavaScript when implementing Python APIs. However, it might still help to look at the JS standards for inspiration.
- In GUI Applications its all about what the user feels. It doesn't matter if your code takes 10 seconds to run, unless the user feels it. If you run that code synchronously and the application freezes for 10 seconds, the user will feel it. If you run it asynchronously, and put in a loading sign the user will still see that it takes some time, but he won't care because he expects that things need time to load. Please use
async
!
To achieve asynchronous code you need two methods:
-
asyncio.to_thread
two turn a synchronous function into an asynchronous one -
util.create_task
to "fire and forget" a coroutine. You can make itsync
which just means that before the page loads the task will definitely have finished. Also you can add an onfinished callback.
- Test on https://acid2.acidtests.org/
-
tinycss
generates tokens like for example<Token PERCENTAGE at 5:19 70%>
, we could use these. Right now we throw them away by callingTokenList.as_css()
- Use aiohttp-client-cache
- animated GIF support (https://yeahexp.com/how-to-insert-animated-gif-into-pygame/)
-
@when
and@else
in CSS: https://css-tricks.com/proposal-for-css-when/ - Profiling:
- Text Search (Ctrl+F) and other popular and familiar shortcuts Select All/Cut/Copy/Paste(Ctrl+A/X/C/V)
-
alpine.js
port