Skip to main content

A Python compiler for the Neo3 Virtual Machine

Project description

Overview

The neo3-boa compiler is a tool for compiling Python files to the .nef and .manisfest.json formats for usage in the Neo Virtual Machine which is used to execute contracts on the Neo Blockchain.

What it currently does…

  • Compiles a subset of the Python language to the .nef and .manisfest.json format for use in the Neo Virtual Machine

  • Works for Python 3.7+

  • Logs compiler errors and warnings

  • Logs when the main method is analysed

  • Logs method inclusions in .abi file to work with Neo Debuggers.

  • Converts Functions

  • Converts Local Variable Declarations and Assignments

foo: int = 42
bar = foo
  • Converts Number Arithmetic Operations (+, -, *, //, %)

  • Converts Numeric Arithmetic Augmented assignment Operators (+=, -=, *=, //=, %=)

  • Converts Relational Operations (==, !=, <, <=, >, >=)

  • Converts Boolean Logic Operations and chained comparisons (and, or, not)

  • Converts Tuple type (get and set operations)

  • Converts List type

  • Converts While Statement

foo = 0
while condition:
    foo = foo + 2
  • Converts If, elif, else Statements

if condition1:
    foo = 0
elif condition2:
    foo = 1
else:
    bar = 2
  • Converts For Statement

for x in (1, 2, 3):
    ...
  • Converts Function Call

def Main(num: int):
    a = foo(num)
    ...

def foo(num: int) -> int:
    ...
  • Converts len() for str, tuple and list

  • Converts Multiple Expressions in the same line (i = i + h; a = 1; b = 3 + a; count = 0)

  • Converts String Slicing (x = 'example'[2:4], x = 'example'[:4], x = 'example'[4:], x = 'example'[:])

What it will do…

  • continue, break and pass

  • Convert Numeric Arithmetic Augmented assignment Operators (/=)

  • Convert Number Arithmetic Operations (/, **)

  • Convert Relational Operations (is, is not)

  • Convert String Slicing (x = 'example'[2:4:2], x = 'example'[::2])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neo3-boa-0.11.0.tar.gz (336.8 kB view details)

Uploaded Source

Built Distribution

neo3_boa-0.11.0-py3-none-any.whl (639.0 kB view details)

Uploaded Python 3

File details

Details for the file neo3-boa-0.11.0.tar.gz.

File metadata

  • Download URL: neo3-boa-0.11.0.tar.gz
  • Upload date:
  • Size: 336.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.8.0 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/19.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for neo3-boa-0.11.0.tar.gz
Algorithm Hash digest
SHA256 9d95d48df011c092121541d5edf7800b471fe69abcedec6b744397ffdf8dde97
MD5 1295c1b7d82cdd28cad5de6f67f69059
BLAKE2b-256 1f774f0cf58de11c3b542ee95252d5569f20269e50d3c3d0557a6aeac8a6edde

See more details on using hashes here.

Provenance

File details

Details for the file neo3_boa-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: neo3_boa-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 639.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.22.0 requests-toolbelt/0.8.0 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/19.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for neo3_boa-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 613fd03b2f7e8d3baa11f0ac20aaf6c9cbcc6836da0a4063fed3fd2123cf4256
MD5 c387719633c52c5d680acb015cbbd367
BLAKE2b-256 41f8141fe088eb9bad12bbbe1ac5a62d98f122dd61551a5f859d24ec4d17ffda

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page