Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hylang/hydiomatic
The Hy Transformer
https://github.com/hylang/hydiomatic
hy logic-programming minikanren python static-code-analysis symbolic-computation
Last synced: 3 months ago
JSON representation
The Hy Transformer
- Host: GitHub
- URL: https://github.com/hylang/hydiomatic
- Owner: hylang
- Created: 2014-01-19T22:10:42.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2019-05-07T16:04:01.000Z (almost 6 years ago)
- Last Synced: 2024-11-08T13:16:34.995Z (3 months ago)
- Topics: hy, logic-programming, minikanren, python, static-code-analysis, symbolic-computation
- Language: Hy
- Size: 242 KB
- Stars: 81
- Watchers: 16
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Hydiomatic
==========[![Build Status](https://img.shields.io/travis/hylang/hydiomatic.svg?style=flat-square)](https://travis-ci.org/hylang/hydiomatic)
[![Downloads](https://img.shields.io/pypi/dm/hydiomatic.svg?style=flat-square)](https://pypi.python.org/pypi/hydiomatic)
[![Version](https://img.shields.io/pypi/v/hydiomatic.svg?style=flat-square)](https://pypi.python.org/pypi/hydiomatic)Hydiomatic is a static code analyser for [Hy](http://hylang.org/),
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][adderall], and can be installed the
usual way with `pip`:```shell
$ pip install -r requirements.txt
```[adderall]: https://github.com/algernon/adderall
Usage
-----The library can be used either via the `hydiomatic` script:
```shell
$ hydiomatic -d FILENAME
```
or programmatically:
```clojure
(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)}]))
```For more information on what the script can do, run `hydiomatic --help`.
Example
--------Here's an example of Hydiomatic updating itself from an older Hy syntax:
```shell
$ git show 5d3c958:bin/hydiomatic.hy > old_hydiomatic.hy
$ hydiomatic -d old_hydiomatic.hy
```License
-------All the code is licensed under the GNU Lesser General Public License
(v3+).