hy/docs/quickstart.rst

49 lines
1.2 KiB
ReStructuredText
Raw Normal View History

2013-04-05 22:30:12 +02:00
==========
Quickstart
==========
.. image:: _static/cuddles-transparent-small.png
2013-06-02 04:02:52 +02:00
:alt: Karen Rustard's Cuddles
(Thanks to Karen Rustad for Cuddles!)
2013-06-02 04:02:52 +02:00
**HOW TO GET HY REAL FAST**:
2013-04-05 22:30:12 +02:00
1. Create a `Virtual Python Environment
<https://pypi.python.org/pypi/virtualenv>`_.
2. Activate your Virtual Python Environment.
3. Install `hy from GitHub <https://github.com/hylang/hy>`_ with ``$ pip install git+https://github.com/hylang/hy.git``.
4. Start a REPL with ``hy``.
5. Type stuff in the REPL::
2013-04-05 22:30:12 +02:00
=> (print "Hy!")
Hy!
=> (defn salutationsnm [name] (print (+ "Hy " name "!")))
2013-04-05 22:30:12 +02:00
=> (salutationsnm "YourName")
Hy YourName!
etc
6. Hit CTRL-D when you're done.
2013-04-05 22:30:12 +02:00
*OMG! That's amazing! I want to write a Hy program.*
2013-04-05 22:30:12 +02:00
7. Open up an elite programming editor and type::
2013-04-05 22:30:12 +02:00
#! /usr/bin/env hy
(print "I was going to code in Python syntax, but then I got Hy.")
2013-04-05 22:30:12 +02:00
8. Save as ``awesome.hy``.
9. Make it executable::
2013-04-06 03:27:30 +02:00
chmod +x awesome.hy
2013-04-06 03:38:18 +02:00
10. And run your first Hy program::
./awesome.hy
11. Take a deep breath so as to not hyperventilate.
12. Smile villainously and sneak off to your hydeaway and do
unspeakable things.