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

I played with it a bit, it's homoiconic, has macros, and papers over the difference between Python statements and expressions (so that everything is expressions).

Seems pretty neat, if you ask me.




Does Hy add its own "symbol" datatype, or use something in the standard library?


Own symbol type

    => 'foo
    HySymbol(u'foo')
Assignment and conditionals are expressions, however assignment returns None.

    => (setv bar (setv foo (if True True False)))
    => (type bar)
    <type 'NoneType'>
Quoted expressions evaluate to Hy AST.

    => '(+ 1 2 3)
    HyExpression([
        HySymbol(u'+'),
        HyInteger(1L),
        HyInteger(2L),
        HyInteger(3L)]
    )
So it's kind of a frontend for the Python compiler, it goes:

Hy AST -> Python AST -> Python bytecode


Users of Hy who don't know Lisp deserve to be informed that in an actual Lisp, it goes more like this:

  => 'foo
  foo
(or, at worst FOO rather than foo).

  => '(+ 1 2 3)
  (1 2 3)




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

Search: