Feasibility of using nuitka to compile script using icepool? #163
Replies: 2 comments
-
Honestly, I haven't put much thought into the native use case so far. For Icepool I decided to go for a web-first strategy, since it's the quickest and easiest way to onboard users and follows the precedent of AnyDice. The timing was right too, with the advent of Pyodide and JupyterLite. Still, web-first doesn't mean web-only, and if Icepool turns out to be using some feature that Nuitka or other solution doesn't support, I would be happy to at least explore alternatives for Icepool. Past this is the question of Python interoperability with a non-Python main program. I don't have much experience with this; my impression is that solutions (and their level of ease of use) exist for specific languages.
I'm glad you like the API! Indeed, the search for more efficient algorithms was motivated not just by speed itself, but to have enough surplus speed to trade for other nice things. Python + WASM incurs a heavy overhead, but in return we get nice language features, interoperability, and ease of distribution. Still, I do find myself sometimes craving a little more responsiveness... |
Beta Was this translation helpful? Give feedback.
-
I belive web first was the right call for sure. From what I've been researching, as a pure python project, I don't believe there should be any big blockers. This is not in my immediate to-do list but just wanted to know if it was something you had considered. Compiling the icepool library + code that does the calculations into native code seems like the best of both worlds, allowing you to keep your complex code in python and just importing it into the platform you need. I'm not sure if there would actually be a speedup in execution time by doing this though. My experience so far has been that icepool is absurdly fast, and even on very slow phones with the full wasm + pyodide overhead calculations seem instant for really high denominators, so my aim is more for portability than performance. I'll let you know when I start playing around with it, it will be open source as well, and an example project might open up some cool use cases. |
Beta Was this translation helpful? Give feedback.
-
I’ve been brainstorming a way to use icepool in a true native iOS or Android app.
Of all the solutions I’ve been looking at Nuitka stood out to me as an interesting solution, as compiling the python script that uses icepool down to a native executable would allow it to be imported as a library in both iOS or Android.
Have you given this use case any thought? Do you think it would be a viable path forward?
Just as a thought, actually attempting to port icepool over to another language like C seems like a worse solution to me. One of the major draws for icepool is the wonderful expressive API, and it leans very hard into pythonic idioms and expressions. A ported version would be fast but I believe it would lack the ease of use that makes icepool stand out.
Beta Was this translation helpful? Give feedback.
All reactions