Hylang - A Python powered Lisp AND a Lisp power...

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Hylang - A Python powered Lisp AND a Lisp powered Python

Hylang is a lisp that is written in python that compiles down to python itself. This is a talk given during the Chennaipy February meetup 2015.

Shrayas Rajagopal

February 28, 2015

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

56 slides
  1. Hy!

  2. 1+1

  3. (+ 1 2 3 4 5) 1 + 2 +

    3 + 4 + 5 Infix S-Expressions
  4. Dialects Arc, AutoLISP, Clojure, Common Lisp, Emacs Lisp, EuLisp, Franz

    Lisp, Interlisp, ISLISP, LeLisp, LFE, Maclisp, MDL, Newlisp, NIL, Picolisp, Portable Standard Lisp, Racket, Scheme, SKILL, Spice Lisp, T, XLISP, Zetalisp
  5. Dialects Arc, AutoLISP, Clojure, Common Lisp, Emacs Lisp, EuLisp, Franz

    Lisp, Interlisp, ISLISP, LeLisp, LFE, Maclisp, MDL, Newlisp, NIL, Picolisp, Portable Standard Lisp, Racket, Scheme, SKILL, Spice Lisp, T, XLISP, Zetalisp
  6. def say_hello(name): print "Hello", name if __name__ == "__main__": say_hello("Python")

    (defn say_hello [name] (print "Hello" name)) (if (= __name__ "__main__") (say_hello "python")) python hylang Hello, python
  7. python hylang Data Structures >>> [1,2,3] >>> {"foo": 1, "bar":

    2, "baz": 3} >>> (1,2,3) => [1 2 3] => {"foo" 1 "bar" 2 "baz" 3} => (, 1 2 3)
  8. python Conditionals if (foo > 5): print "foo more than

    5!" else: print "foo less than 5!"
  9. python hylang Conditionals if (foo > 5): print "foo more

    than 5!" else: print "foo less than 5!" (if (> foo 5) (print "foo more than 5!") (print "foo less than 5!"))
  10. python Conditionals (more) if (foo > 7): print "Too much"

    elif (foo < 7): print "Too less" else: print "ok :)"
  11. hylang Conditionals (more) (cond [(> foo 7) (print "Too much")]

    [(< foo 7) (print "Too less")] [true (print "ok :)")])
  12. python (usemath.py) hylang (hymath.hy) Interop! (defn square [x] "returns square

    of x" (* x x)) import hy import hymath print hymath.square(8)
  13. hylang is a pythonic lisp 1 Has great interop with

    python 2 Great excuse to learn Lisp 3 Recap
  14. hylang is a pythonic lisp 1 Has great interop with

    python 2 Great excuse to learn Lisp 3 A new language 4 Recap

More Decks by Shrayas Rajagopal

Other Decks in Programming