Skip to content

koji-kojiro/hylang-hypo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypo

MIT License python PyPI
Hy is a LISP dialect running on a Python virtual machine. Hypo allows you to build small applications from Hy source files. Similar to Python's zipapp, Hypo creates executable archives. Since the Hy source files will be compiled into .pyc files, the executable archive will run faster than on interpreter.

Requirements

  • Python >= (2.6, 3.5)
  • Hy >= 0.12.1

Installation

$ pip install hypo

Usage

$ hypo --help
usage: hypo [options] <targets>

options:
  -o [file]  output name
  --version  show program's version number and exit
  --help     show this message and exit

Example

You can build these source files as follows:

$ hypo -o app main.hy iota.hy

And you can execute the application as follows:

$ ./app
(0L 1L 2L 3L 4L 5L 6L 7L 8L 9L)

or

$ python app
(0L 1L 2L 3L 4L 5L 6L 7L 8L 9L)

Source files

  • iota.hy
(defn iota [m &optional [n 0] [step 1]]
  (if (>= n m)
    None
    (cons n (iota m (+ n step) step))))
  • main.hy
(import [iota [iota]])

(defmain [&rest args]
  (print (iota 10)))

License

Distributed under MIT License.

Author

Kojiro TANI (kojiro0531@gmail.com)

About

Build small applications from Hy source files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published