The Hy Transformer
Hy Python
Pull request Compare This branch is 2 commits behind hylang:master.
Latest commit 7eeb70b Oct 11, 2015 @algernon Add a pretty/simplify macro to utils
Also require hydiomatic.utils in bin/hydiomatic.hy, so that it will be
available on the REPL.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>

README.md

Hydiomatic

Build Status Downloads Version

Hydiomatic is a static code analyser for Hy, that can analyse a form, and suggest a simplification, or a more idiomatic alternative.

The software is under heavy development, and has serious limitations, but it can already perform interesting transformations.

Installation

Hydiomatic depends on adderall, and can be installed the usual way with pip:

$ pip install -r requirements.txt

Usage

The library can be used either via the bin/hydiomatic.hy script:

$ bin/hydiomatic.hy -d FILENAME

For more information on what the script can do, run bin/hydiomatic.hy --help.

Or programmatically:

(import [hydiomatic.core [*]])

(simplify '(if (not (= 0 (- 1 1)))
             (do (print (+ 1 (+ 2 3)) [a b {"c" (+ a 1)}]))))
;=> (unless (zero? (dec 1))
;     (print (+ 1 2 3) [a b {"c" (inc a)}]))

License

All the code is licensed under the GNU Lesser General Public License (v3+).