crython
Crystal meets Python! Experiment on how a Python interpreter can be embedded in Crystal.
Current status: PoC
Installation
A Python interpreter is required as a dependency.
Ensure python-config --ldflags
works.
Since Python's C API expose some constants or functions using preprocessor macros, crython
uses a thin static library written in C (see src/ext/crython.c
) that re-exports them with a fixed C API.
Use make
with the optional variables release=1
or debug=1
to build the static library. Note that make release=1
is automatically executed by shards
as a postinstall script.
Add this to your application's shard.yml
:
dependencies:
crython:
github: RomainFranceschini/crython
Usage
require "crython"
See examples
folder.
Use make examples
with the optional make variables release=1
or debug=1
to build all examples.
Development
TODO Write development instructions here
Contributing
- Fork it (https://github.com/RomainFranceschini/crython/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Romain Franceschini - creator, maintainer