Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thautwarm/reley
haskell-like compiled language based on Python VM
https://github.com/thautwarm/reley
compiled-language haskell python-bytecode python3
Last synced: 2 months ago
JSON representation
haskell-like compiled language based on Python VM
- Host: GitHub
- URL: https://github.com/thautwarm/reley
- Owner: thautwarm
- License: mit
- Created: 2018-09-12T15:24:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-16T08:27:41.000Z (over 6 years ago)
- Last Synced: 2024-10-31T16:51:14.538Z (3 months ago)
- Topics: compiled-language, haskell, python-bytecode, python3
- Language: Python
- Homepage:
- Size: 78.1 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/thautwarm/reley.svg?branch=master)](https://travis-ci.org/thautwarm/reley)
See examples at `haskell_test/*.hs`.
Currently you can install reley compiler with `python setup.py install`.Usage
============- Compile:
```
> reley cc .hs -o .pyc
> python .pyc
```- Run Reley
```
> reley run .hs
```- Import reley programs in Python
If you have a reley source file `haskell_test/sum_n.hs`:
```haskell
module
m_sum, (==) -- export `m_sum` and `(==)`
whereimport operator (add, eq)
import functools (reduce)
import toolz (curry)
import reley.prelude ((+))infix 5 (==)
infix 0 ($)
(==) = curry eq
($) a b = a b
(+) = curry addm_sum lst = if lst == [] then 0
else destruct lst
where
destruct (a, b) = a + m_sum(b)main () =
print $ m_sum [1, 2, 3, 4, 5, 6]```
Then you can import it in Python
```python
import reley.impl.pycompatfrom haskell_test.sum_n import m_sum
lst = (5, (2, (1, ())))
print(m_sum(lst))```
About Reley
====================
It's in an early stage with many shortages.
Most of the crucial Haskell features are missing.