Hacker News new | past | comments | ask | show | jobs | submit login

Racket is great if you are looking for a high quality general purpose language, but if you want to use important python libraries for pythons's popular use cases: numerical/scientific computing, data science/ai, etc., then Hylang is a drop-in replacement with the added benefit of Metaprogramming facilities (Lisp-2 macros) and Clojure-like semantics.

Python and Hy have 100% interoperability. Python can call Hy out of the box, and Hy can call Python out of the box.

Any Python programmer can pick up Hy basics in minutes, and will be productive in a matter of hours. If you are an intermediate level Python programmer and have experience with Lisp macros, you will be writing macros in no time as well. Writing macro wrappers for numerical/scientific applications can increase your code's signal to noise ratio by quite a lot.

docs: http://docs.hylang.org/en/stable/

github: https://github.com/hylang/hy

get it:

  pip install hy



Actually Hy is mentioned in the article, though the author found it didn't fit his usecase.

> Alas, Hy didn't really reach my dream. That macro expansion made debugging a nightmare as Hy would lose track of where the line numbers are; it wasn't until that when I really realized that without line numbers, you're just lost in terms of debugging in Python-land. That and Python didn't really have the right primitives; immutable datastructures for whatever reason never became first class, meaning that functional programming was hard, "cons" didn't really exist (actually this doesn't matter as much as people might think), recursive programming isn't really as possible without tail call elimination, etc


Debugging macro expanded code is definitely the number one pain with Hy, although a somewhat workable solution is to view the output of hy2py (comes with hy).

As far as the lack of functional programming semantics go (no tail call elimination is very sad indeed), there is no denying that either, but considering the applications I am recommending (c/c++ inter-op with python wrappers), you are hardly working in a functional domain in the first place.


http://coconut-lang.org/ is another variant, but retains most of the python syntax.


This is amaazing! Thanks for relaying this information.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: