A simple pythonic programming language for Smart Contracts on Cardano
Project description
Eopsin
This is a prototypical implementation of smart contracts for Cardano which are written in a very strict subset of valid Python. The general philosphy of this project is to write a compiler that ensure the following:
If the program compiles then:
- it is a valid Python program
- the output running it with python is the same as running it on-chain.
This specificially means that not every valid python program is a valid smart contract.
Not all language features of python will or can be supported.
The reasons are mainly of practical nature (i.e. we can't infer types when functions like eval
are allowed).
Specifically, only a pure subset of python is allowed. Further, only immutable objects may be generated.
For your program to be accepted, make sure to only make use of language constructs supported by the compiler. You will be notified of which constructs are not supported when trying to compile.
Architecture
This program consists of a few independent components:
- An aggressive static type inferencer
- Rewriting tools to simplify complex python expressions
- A compiler from a subset of python into UPLC
Installation
Install Python 3.10. Then run
python3 -m pip install eopsin-lang
Running
Write your program in python. You may start with the example.py
.
Then run
python3 -m eopsin compile example.py
Name
Eopsin (Korean: 업신; Hanja: 業神) is the goddess of the storage and wealth in Korean mythology and shamanism. [1]
Since this tries to merge Python (a large serpent) and Pluto/Plutus (Greek wealth gods), the name appears fitting. Also there are no naming conflicts.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for eopsin_lang-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a9ef5d52b016d057650914f801aafe108216778500cad2dd67d6be6c5b5fa1 |
|
MD5 | 710a43cde3ce752d0fdd173e86070702 |
|
BLAKE2b-256 | 503c845ba89271ef2899ce818e095b85893f7de93c3a9359a41ccf287cf50233 |