bitter-ability-32190
02/01/2022, 3:00 PMmypyc
? š¤bitter-ability-32190
02/01/2022, 3:01 PMbitter-ability-32190
02/01/2022, 3:01 PMhundreds-father-404
02/01/2022, 3:17 PMbitter-ability-32190
02/01/2022, 3:21 PMbitter-ability-32190
02/01/2022, 5:38 PMmypyc
. Then Pants could just dogfood the compilation.wide-midnight-78598
02/01/2022, 5:38 PMbitter-ability-32190
02/02/2022, 3:07 PMI wonder if you could eliminate the roundtrip by the runtime form Rust -> Python runtime -> Python compiled binary and just go from Rust -> compiled codeI suppose this is approximately the overhead of an additional C function call though š¤
bitter-ability-32190
02/02/2022, 3:07 PMwide-midnight-78598
02/02/2022, 3:20 PMbitter-ability-32190
02/02/2022, 3:26 PMbitter-ability-32190
03/07/2022, 2:26 PMbitter-ability-32190
03/07/2022, 2:26 PMpants
run, and then try to mypyc
the a file or two, though)wide-midnight-78598
03/07/2022, 3:31 PMbitter-ability-32190
03/07/2022, 3:35 PMinspect
the caller's frame, which is how collect_rules()
works)bitter-ability-32190
03/07/2022, 3:36 PMmypy
is proof of that. You just have to limit yourself to the contraints mypyc
places.wide-midnight-78598
03/07/2022, 3:40 PMbitter-ability-32190
03/07/2022, 3:43 PMpants
uses a compiled pex
which on installation of black
compiles it?wide-midnight-78598
03/07/2022, 3:45 PMwide-midnight-78598
03/07/2022, 3:46 PMbitter-ability-32190
03/07/2022, 3:47 PMwide-midnight-78598
03/07/2022, 3:49 PMbitter-ability-32190
03/07/2022, 3:49 PMbitter-ability-32190
03/07/2022, 3:50 PMwide-midnight-78598
03/07/2022, 3:50 PMwide-midnight-78598
03/07/2022, 3:53 PMbitter-ability-32190
03/07/2022, 3:55 PMwide-midnight-78598
03/07/2022, 3:57 PMwide-midnight-78598
03/07/2022, 3:57 PMbitter-ability-32190
03/07/2022, 3:58 PMbitter-ability-32190
03/07/2022, 3:58 PMwide-midnight-78598
03/07/2022, 3:59 PMbitter-ability-32190
03/07/2022, 4:01 PMmypy
in repo. Note that newer mypy
is somewhat stricter
⢠Move towards full typing in-repo and --strict
hundreds-father-404
03/07/2022, 4:12 PM.pyc
https://github.com/pantsbuild/pants/issues/11339wide-midnight-78598
03/07/2022, 4:14 PMbitter-ability-32190
03/07/2022, 4:14 PMwide-midnight-78598
03/07/2022, 4:14 PMhundreds-father-404
03/07/2022, 4:15 PMbitter-ability-32190
03/07/2022, 4:24 PMhundreds-father-404
03/07/2022, 4:27 PMthe real pitfalls would've exposed themselves (e.g. you can't inspect the caller's frame, which is how collect_rules() works)Would it be helpful to memorialize the concrete issues you encountered in a GitHub issue perhaps? Iirc it was decorators like
@frozen_after_init
and then collect_rules
?
On par, I continue to personally prioritize end-user experience over plugin author experience. (Although of course important to balance that). So I'd be curious to see all the things we'd have to "give up" for better perf
To be clear, please don't go on a wild goose chase tho trying to catalog even more issues. Makes sense to not try pursuing this more for now. Rather, to memorialize the work you already didbitter-ability-32190
03/07/2022, 4:42 PMdataclass
⢠comparison operators must return bools
⢠...probably much more but didn't inspect the compiler output in each casebitter-ability-32190
03/07/2022, 4:43 PM--strict
, and minimizing `cast`/`# type: ignore`wide-midnight-78598
03/07/2022, 4:49 PMwide-midnight-78598
03/07/2022, 4:50 PMbitter-ability-32190
03/07/2022, 4:59 PMbitter-ability-32190
03/07/2022, 5:00 PMhundreds-father-404
03/07/2022, 5:01 PMbitter-ability-32190
03/07/2022, 5:02 PMwide-midnight-78598
03/07/2022, 5:06 PMmypy --strict
test, and using an inner function works fine, but returning an inner function requires some finesses methinks, as it complained about something that I don't think was tru
https://mypy.readthedocs.io/en/stable/common_issues.html#narrowing-and-inner-functionsbitter-ability-32190
03/07/2022, 5:08 PMmypyc
may/may not allow inner functions with captured variables. As those can't be converted to native C functions easilywide-midnight-78598
03/07/2022, 5:13 PMhundreds-father-404
03/08/2022, 2:06 PMbitter-ability-32190
03/08/2022, 2:46 PMmpypyc
compiled sources. Benefits: super speedy Python codewide-midnight-78598
03/08/2022, 4:23 PMmypyc
and/or Cython up and running would be great. I currently use Cython for running Python on serverless deployments - pays itself off immediately, every call
⢠Single-file deployment to remove Docker as a dependency
⦠PyOx is only sometimes single-file deployment, depends on a bunch of factors - I'm trying to find ways to crack this one - so we can reliably assume single-file deployment, and having a folder of libs is some edge casehundreds-father-404
03/08/2022, 4:27 PMwide-midnight-78598
03/08/2022, 4:53 PMwide-midnight-78598
03/08/2022, 8:07 PMwide-midnight-78598
03/08/2022, 8:08 PMhundreds-father-404
03/08/2022, 8:30 PMvenv
vs zipapp
https://www.pantsbuild.org/v2.10/docs/reference-pex_binary#codeexecution_modecodewide-midnight-78598
03/08/2022, 8:33 PMvenv
is the way to go methinks, I'm just trying to see if PyOxidizer will even run that as a module, and if I can bundle it as a resource. I'm just not sure, theoretically, if that should or shouldn;t work. Reading through the docs to find out, hoping for something that works in any waywide-midnight-78598
03/08/2022, 8:40 PM.pex
as a module?wide-midnight-78598
03/08/2022, 8:40 PMhappy-kitchen-89482
03/09/2022, 4:51 AM