Live data from Hacker News

Hy 1.0 – Lisp dialect for Python

github.com

61–70 of 131 posts

Re: Hy 1.0 – Lisp dialect for Python

#61
I remember Hy! It blew my mind back in 2014 and is still cool today, it's great to see it still going and congrats on releasing 1.0.0!

Also great timing after the recent Python Preprocessor post: https://pydong.org/posts/PythonsPreprocessor/

Could Hy hypythetically be implemented as a preprocessor like https://github.com/tomasr8/pyjsx?

Re: Hy 1.0 – Lisp dialect for Python

#62

Earlier quoted context omitted.

and for those interested in history, Docker was first announced 10 minutes afterwards on the 26:24 mark.

Now I know how those guys felt who were on the same episode of Ed Sullivan that introduced the Beatles.

There is a reason why Hylang was one of the first official Docker images!

Re: Hy 1.0 – Lisp dialect for Python

#63

I remember Hy! It blew my mind back in 2014 and is still cool today, it's great to see it still going and congrats on releasing 1.0.0! Also great timing after the recent Python Preprocessor post: https://pydong.org/posts/PythonsPreprocessor/ Could Hy hypythetically be implemented as a preprocessor like https://github.com/tomasr8/pyjsx ?

Hy-pothetically, yes, you could take Hy code in and spit Python code out via `hy2py`. I think at one point I considered supporting this officially, but then decided there was really no advantage.

Re: Hy 1.0 – Lisp dialect for Python

#64

I'm wondering, is it worth learning Hy if I don't know any python? (coming from a clojure background) Or is python knowledge a prerequisite?

Learning Python is not required to get started and do some simple stuff, but it is effectively required to master Hy.

Re: Hy 1.0 – Lisp dialect for Python

#65

Yay! The birth of a language is a beautiful thing. I’m curious about the macros: how are these implemented? They seem like pretty straightforward unhygienic Lisp macros, which is a little bit of a disappointment, but better some macros than none at all! Anything about the macro system that distinguishes it from the Common Lisp system? E.g. anything borrowed from Scheme or Racket? Docs are sparse here.

Sparse? I got a whole chapter for ya: https://hylang.org/hy/doc/v1.0.0/macros

Re: Hy 1.0 – Lisp dialect for Python

#66

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).

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.

Re: Hy 1.0 – Lisp dialect for Python

#67

(one) nice thing about Raku is it does a surprisingly good lisp impression out of the box… https://www.codesections.com/blog/raku-lisp-impression/ [thanks to Larry Wall’s penchant for collecting stuff]

Strange, the Lisp example has a lot of syntax, even though the article claims it hasn't.

letrec, lambda, or & and are not functions in Scheme.

Re: Hy 1.0 – Lisp dialect for Python

#68
post #28

Any downsides to using Hy (over Python)? Other than my coworkers don't know Lisp? More concrete: Are there Python language features I can't use in Hy? Or performance penalties in using Hy?

Sure - you are piling another transpilation layer on top of already slow Python.

Why not just use something closer to the metal: Common Lisp, Scheme, Clojure, Racket? Especially, use a compiled language, instead of an interpreter.

Re: Hy 1.0 – Lisp dialect for Python

#69
post #28

Any downsides to using Hy (over Python)? Other than my coworkers don't know Lisp? More concrete: Are there Python language features I can't use in Hy? Or performance penalties in using Hy?

Sure - you are piling another transpilation layer on top of already slow Python. Why not just use something closer to the metal: Common Lisp, Scheme, Clojure, Racket? Especially, use a compiled language, instead of an interpreter.

If I were to guess, it's to be able to use the all the packages in the Python ecosystem, directly. It's for situations in which Python is already a given. In fact, it's probably the case that many Python programmers can't even use this, due to being in a situation in which even the poor syntax is nonnegotiable.
Post reply on HN