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.9.0.tar.gz (262.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neo3_boa-0.9.0-py3-none-any.whl (504.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: neo3-boa-0.9.0.tar.gz
  • Upload date:
  • Size: 262.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.0 CPython/3.8.0

File hashes

Hashes for neo3-boa-0.9.0.tar.gz
Algorithm Hash digest
SHA256 ef4daf93571ed3cfbcc67d2a541f858bcacf8d052956e8a8af62c84483061baf
MD5 b33da94a28ae308e99dd624a540764b6
BLAKE2b-256 023cc1067779d0f8c332d5f47a7674048a0c185e75aa17ad926992efe175ca1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: neo3_boa-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 504.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.8.0 tqdm/4.62.0 CPython/3.8.0

File hashes

Hashes for neo3_boa-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 655ea45c2f6b2e9bebcc0dc0627edac7b0e49181b4eb500d2a0570d7a372cf9b
MD5 6002538b54b0c6a1fba83eb41ec6581e
BLAKE2b-256 3b7e2c2885b2a4dd6fdc84dca736c86b3a7a166ec5bd8f91724a75bcaf4a8b04

See more details on using hashes here.

Supported by

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