hy/tests/native_tests
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
..
contrib Fix bug: loop replaced strings equal to "recur" 2017-03-30 15:49:10 -07:00
extra Automatically read and write bytecode 2017-04-14 13:38:33 -07:00
__init__.hy ideas, ideas. 2013-03-05 18:39:34 -05:00
cons.hy Remove car and cdr in favor of first and rest (#1241) 2017-03-06 10:34:40 -06:00
core.hy Make setv always return None 2017-03-24 06:38:30 +02:00
defclass.hy Remove uses of let from various tests 2017-02-04 09:07:27 -08:00
language.hy Fix bug with unset __name__ of one-line functions 2017-04-13 06:36:00 +03:00
mathematics.hy Remove uses of let from various tests 2017-02-04 09:07:27 -08:00
native_macros.hy Add bytestring literals 2017-02-19 09:04:45 +02:00
py3_only_tests.hy Remove uses of let from various tests 2017-02-04 09:07:27 -08:00
quote.hy Remove car and cdr in favor of first and rest (#1241) 2017-03-06 10:34:40 -06:00
reader_macros.hy Make setv always return None 2017-03-24 06:38:30 +02:00
shadow.hy Remove uses of let from various tests 2017-02-04 09:07:27 -08:00
unless.hy Burninate the synonyms true, false, and nil 2016-11-23 18:35:17 -08:00
when.hy Burninate the synonyms true, false, and nil 2016-11-23 18:35:17 -08:00
with_decorator.hy Revert the extension of with-decorator to setv 2017-04-13 06:36:00 +03:00
with_test.hy Drop a set of brackets from with. 2015-10-01 10:08:04 +02:00