News for hackers. Stuff that matters.
Re:Introducing PyScript (summary of PyCon keynote) by stavros on Wednesday June 22, 2022 @10:40PM (#31844585)
This is a laudable effort, but I'm not a fan of shipping the entire interpreter. I looked around a few weeks ago and found https://transcrypt.org, which compiles your Python script to JS, so size is minimal.

It's great for shipping small, internal tools/apps, I love how maintainable they are by all the Python devs, plus they're very fast to load and execute.

Re:Introducing PyScript (summary of PyCon keynote) by jennasys on Wednesday June 22, 2022 @10:58PM (#31844695)
I agree. I've been using Transcrypt to create React applications using Python. It allows you to take advantage of existing JS libraries and bundlers but still code in Python. I have to say, it has been really nice not having to switch languages between front-end and back-end on a fullstack application.

I did a writeup with a basic how-to a while back: https://dev.to/jennasys/creating-react-applications-with-pyt...

Re:Introducing PyScript (summary of PyCon keynote) by brundolf on Wednesday June 22, 2022 @10:51PM (#31844660)
I imagine compiling Python to JS instead of Wasm is a very leaky abstraction. Probably fine for simple stuff, but more complex Python code might not behave exactly as expected
Re:Introducing PyScript (summary of PyCon keynote) by stavros on Wednesday June 22, 2022 @10:53PM (#31844669)
Yeah, certainly, but I wouldn't really advise using Python in the browser for more complex code yet.
Re:Introducing PyScript (summary of PyCon keynote) by nope96 on Thursday June 23, 2022 @12:14AM (#31845097)
Also check out "rapydscript-ng", by the author of Calibre e-book reader:

https://github.com/kovidgoyal/rapydscript-ng

Re:Introducing PyScript (summary of PyCon keynote) by cycomanic on Thursday June 23, 2022 @12:49AM (#31845250)
How does that work for numpy or scipy? A main point of using python is the ecosystem.
Re:Introducing PyScript (summary of PyCon keynote) by ordiel on Wednesday June 22, 2022 @11:58PM (#31845027)
I am amazed I am apparently the only one mentioning Brython over here

https://www.brython.info/