by HexDecOctBin · 2y ago · 0 comments
1. Does it support REPL-driven development? (condition system, breakloop, etc.)
2. Is there a standalone distribution? Distributing python in itself is a hassle, ideal situation would be to simply distribute a single Hy binary that contains all dependencies within it (either statically linked or as a zip file extracted in tmp directory).
uvx hy@1.0.0
gets you into the Hy REPL echo '(print "hi hn")' > hi.hy
uvx hy@1.0.0 hi.hy
prints "hi hn"https://docs.astral.sh/uv/guides/tools/#running-tools
(context: uv can install and manage python versions)
2. No, sorry.
Seems like that would only be doable by altering CPython to at least have a hook in the initial exception processing (or maybe there is some magic double-underscore thing for that already?).
>A convenient way to use this class to interactively debug code is to insert the following in the code you want to debug:
(.run (hy.REPL :locals {#\* (globals) #\* (locals)}))
>Or in Python: import hy; hy.REPL(locals = {\*globals(), \*locals()}).run()
>Note that as with `code.interact()`, changes to local variables inside the REPL are not propagated back to the original scope.