Readit News logoReadit News
rthz commented on Tauri binding for Python through Pyo3   github.com/pytauri/pytaur... · Posted by u/0x1997
rthz · 2 months ago
Nice. It might be worth copying some of the introductory text from the Tauri package explaining what this does. Otherwise a person to lands on the readme gets a lot of technical detail about how it is built without any idea what it actually does.
rthz commented on Noise cancelling a fan   chillphysicsenjoyer.subst... · Posted by u/crescit_eundo
rthz · 3 months ago
Interesting problem, not sure it’s worth solving. A larger diameter and slower rotating fan would likely produce less noise for a comparable air flow.
rthz commented on Audiobookshelf: Self-hosted audiobook and podcast server   audiobookshelf.org/... · Posted by u/fjk
senectus1 · 8 months ago
been using it for a couple of years now. its an absolute cracker.

Pity the iOS app is almost impossible to get.

rthz · 8 months ago
On iOS you can use the plappa client. It’s open source and works well in my experience.
rthz commented on The Eval Game   oskaerik.github.io/theeva... · Posted by u/sfoley
iainmerrick · 2 years ago
Not working at all for me; looks like this import is failing:

https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js

JSDelivr is supposedly up, but the CDN isn't working for me at all. Is it blocked in the UK?? That seems like a big deal if so.

I see some past discussion here about it being possibly banned in the EU: https://news.ycombinator.com/item?id=35793009

rthz · 2 years ago
Pyodide maintainer here, we would have certainly seen more reports if JsDelivr was blocked in UK. That URL works fine for me from France, and when using a UK VPN end point. Maybe something specific about your network (corporate proxy etc)?

Are you getting an HTTP status other than 200 or the domain name not being resolved?

rthz commented on WASM: Big deal or little deal?   theregister.com/2023/09/0... · Posted by u/elorant
tyingq · 2 years ago
Python running well in WASM requires WASM to be more like a virtual machine (as in JVM, not KVM) and less like ASM. WASM is headed that way, with things like GC. But then you also need direct DOM integration. And even if you have both of those working well, Python's runtime and stdlib are pretty large, and if everyone picks a different version of Python they want to run, there's no economy of scale. Couple that with browsers all killing off the advantage of shared libraries in a CDN via cache partitions. It feels like the road to all of that working reasonably well in all situations is pretty long.
rthz · 2 years ago
It's done currently in Pyodide: Python with DOM integration running with WASM. Minimal application with stdlib is around 5.5MB after compression now. Not small but still manageable depending on the use case.

Still I agree with your other comments, and in particular not being able to share caches in the browser is very unfortunate (but understandable).

rthz commented on Functools – The Power of Higher-Order Functions in Python   martinheinz.dev/blog/52... · Posted by u/gilad
rthz · 4 years ago
For people wanting to do more functional programming in Python, have a look at toolz (https://toolz.readthedocs.io/en/latest/). It goes a bit further in that direction.
rthz commented on Pyodide: Python for the Browser   lwn.net/SubscriberLink/85... · Posted by u/lukastyrychtr
jokoon · 5 years ago
Any other way to agree with CORS without a webserver? What about embedding some js code, or moving the WASM files locally?

Thanks for the answers.

Cheers and good luck for this project, I can't wait for it to progress!

rthz · 5 years ago
You can work around it by embedding data into HTML files but it's really not recommended https://github.com/pyodide/pyodide/pull/606
rthz commented on Pyodide: Python for the Browser   lwn.net/SubscriberLink/85... · Posted by u/lukastyrychtr
KMnO4 · 5 years ago
I’m concerned with the performance. It’s up to 16x slower than native Python, which we already know is 100x(?) slower than native code.

So roughly 1600x more clock cycles are consumed than is necessary.

I’m already jaded with the extreme bloat of JS frameworks as it is (how many times does my computer need to ramp up fans because of your React blog?). This could potentially be an order of magnitude worse.

rthz · 5 years ago
Concrete Python applications wouldn't be 100x faster if re-coded in some low level language.

In most places where performance matter Python packages would be using either C extension, Cython or numba to get near native performance. Pyodide is able to build those packages (except for numba). So overall it's currently 3 to 5 slower than native Python (which uses C extensions). See detailed benchmarks in https://hacks.mozilla.org/2021/04/pyodide-spin-out-and-0-17-...

rthz commented on Pyodide: Python for the Browser   lwn.net/SubscriberLink/85... · Posted by u/lukastyrychtr
jokoon · 5 years ago
> Well you need to be able to serve static files. So if you are building locally you need to start a webserver, otherwise you can use the JsDelivr CDN.

I don't understand, can't I just use offline, static files ?

I would still expect to use my own webserver, unrelated to pyodine, like flask or whatever.

> Yes, we are working on adding more examples.

Glad to hear this :) !

> Why do you find the example misleading?

I haven't really seen that example in the doc or elsewhere, and I don't understand the steps required to make such example work offline or without a webserver.

EDIT:

Another cool thing of brython is that could "inline" a python script inside a html file, such as:

    <script type="script/python">
or

    <script src="thing.py"></script>

rthz · 5 years ago
If you just open an HTML file in your browser via its local path (e.g. /home/user/...) the browser will prevent you from loading other files by JS due to CORS. So we need a web-server to set the appropriate CORS headers. Any web-server would do.

For inline code, yes it would be doable someone would need to continue https://github.com/pyodide/pyodide/pull/692

For examples, I'll respond in the Pyodide issue where you commented.

u/rthz

KarmaCake day38January 6, 2018
About
Data scientist
View Original