Skip to content

Comment on A possible future of Python in the browser

Comments

very interesting. So all the declarative stuff, like various type descriptions and preconditions and such, can be precompiled.. (and i am not talking about type-hints/annotations). Maybe some of the meta-programming stuff too.

i was thinking some weeks ago that it may be time to "fork" python - as language - in a way to preserve the initial simplicity and clarity it did have and is losing faster and faster. But, nevermind. Will have to live with whatever there is.

edit: looking at the code, some things might be optimized but no idea if these are on critical path (like, that switch-by sq_idx, or 6 lines.append.. ), or whether func-calls are as expensive in Spy as they are in Cpy. But anyway, squeezing few percents is not the point.. if one needs magnitudes.

(SPy author here) function calls in SPy are as cheap as in C.

You can check by yourself seeing of the spy compiler translates the code to C in the (super-experimental) spy playground: https://antocuni.pyscriptapps.com/spy-playground/latest/

i was thinking some weeks ago that it may be time to "fork" python - as language - in a way to preserve the initial simplicity and clarity it did have and is losing faster and faster.

I've had this thought, and seen others express it. The main problem is there is no general agreement on what should or shouldn't make the cut.

I've sort-of designed a new language from scratch, but I haven't been able to convince myself to make time to implement anything significant, or even really discuss what I've already figured out in any detail.

I do like Mr. Langa's idea about pre-computed ("@blue") code - although it doesn't strike me as particularly novel. (It's something I want to do in my own language, too - or rather, I have in mind a metaprogramming system, so you'd have macros that manipulate the AST and either insert a result when it's fully determined at compile time, or runtime code otherwise.)

Actually i don't have that much of a problem with the language itself - the new additions are not mandatory nor breaking old stuff, by design. But the way some are used - and started to be applied and forced-down-throat regardless of usecase - leaves me wanting those features to be absent. Better not have gold at all than turn everything into gold - it's not edible.. (here mostly talking about the type-hinting frenzy. But, no point repeating myself)

The actual code example he made runs about 100 times faster in Spy/emscripten than in Pyodide.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.