5 ms·
Congrats! Two questions: 1. Does it support REPL-driven development? (condition system, breakloop, etc.) 2. Is there a standalone distribution? Distributing p
by HexDecOctBin 2y ago
Congrats! Two questions:
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).
- rcarmo 2y agoI managed to do 2, sort of, with py2app and judicious hacking. You can compile everything to byte code and use Python "single file" deployment tools.
- tosh 2y agonot a standalone distribution but: 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 https://docs.astral.sh/uv/guides/tools/#running-tools (context: uv can install and manage python versions)
- PaulHoule 2y agoGenerally, uv answers the objection that ‘Python sux’ in that it (1) is correct, unlike pip, and (2) is freaky fast.
- Snowfield9571 2y agoExcept uv doesn’t support conda so there goes many of the niche scientific packages required for many users like me. Someone please prove me wrong because I do love uv when I can use it. I’ve found pixi to be an ok alternative but not nearly as fast.
- Kodiologist 2y ago1. I don't know what a breakloop is. Hy uses Python's exception system, which is more like a traditional exception system than Common Lisp's condition system. 2. No, sorry.
- wrs 2y agoA breakloop is a REPL operating in the context of condition handling. When a condition is signaled, you can use the breakloop to modify state and direct how the condition should be handled (including fixing something local and letting the current function proceed by ignoring the condition). 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?).
- Kodiologist 2y agoI see. That's pretty similar to the feature set of [pdb](https://docs.python.org/3/library/pdb.html https://docs.python.org/3/library/pdb.html). You may then logically ask "Does Hy support pdb?". The answer is "sort of". I've fixed one or two bugs, but we don't test it. I suspect there are various features of pdb that assume Python syntax and would need some hooks to get working properly with Hy.
- deleted 2y ago[deleted]
- ruined 2y agohttps://hylang.org/hy/doc/v1.0.0/repl https://hylang.org/hy/doc/v1.0.0/repl >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.
- nerdponx 2y ago1. It supports the same set of features that python supports, which is pretty good when it comes to things like traditional step through and postmortem debugging. And CPython Supports a lot of internal hooks if you want to do really advanced dark magic. But it doesn't have anything like the condition system or handlers/restarts.