hy/tests/resources
Kodi Arfer 2b11b9be20 Automatically read and write bytecode
Importing or executing a Hy file now loads the byte-compiled version if it exists and is up to date, and if not, the source is byte-compiled after it's parsed.

This change can speed up Hy a lot. Here are some examples comparing run times of the current master (491b474e) to this commit, on my laptop with Python 3.6:

- `nosetests --exclude='test_bin'` goes from 3.8 s to 0.7 s (a 5-fold speedup)
- `hy -c '(print "hello world")` goes from 0.47 s to 0.20 s (a 2-fold speedup)
- Rogue TV's startup goes from 3.6 s to 0.4 s (a 9-fold speedup)

Accompanying changes include:

- `setup.py` now creates and installs bytecode for `hy.core`, `hy.contrib`, and `hy.extra`.
- The `hyc` command under Python 3 now creates bytecode in `__pycache__`, as usual for Python 3, instead of putting the `.pyc` right next to the source file like Python 2 does.

I've removed a test of `hy.extra.anaphoric.a-if` that triggers #1268 when the test file is byte-compiled and then hits some weird `macroexpand` bug or something when I try to work around that—Nose crashes when trying to produce an error message, and I can't seem to replicate the bug without Nose.
2017-04-14 13:38:33 -07:00
..
bin Automatically read and write bytecode 2017-04-14 13:38:33 -07:00
importer Don't leave cruft around in sys.modules when an import fails. 2013-07-06 20:37:44 +02:00
__init__.py Test importing things with dashes 2013-04-07 09:54:53 -04:00
argparse_ex.hy Rewrite the bootstrap macros in hy 2013-09-29 18:13:28 +02:00
icmd_test_file.hy Minor test reorganization 2017-02-24 12:47:35 -08:00
tlib.py Give require the same features as import (#1142) 2016-11-03 09:35:58 +02:00