Ontology is dedicated to creating a collaborative open-source tech community. This requires constantly improving development tools and support to give developers easy access to decentralized technology.

We are excited to announce the release of Ontology Neptune, the new Python Compiler, which includes more syntax features and precise syntax checking while maintaining Python semantics, enabling developers to harness the power of smart contracts.

If you are a developer, make sure you have joined our Discord, there you can interact with Ontology core team developers and community developers. Also, take a look at the Developer Center on our website, there you can find developer tools, documentation, and more.

You can find Ontology Neptune on our Github.

Compiler features

Rewrite the compilation framework to implement a compilation process based on an abstract syntax tree. Keywords like break and continue are supported and can be used in any nested loop. Support for logical operations while keeping Python semantics.

e.g. if a == 2 or (a == 5 and b == 4) or a == 3 and a == 7 Support for keywords like while, for, and loop else. Support for in keyword. You can use a statement in the form of if a in list. Support to write as many statements as you like on a single line. Global variables can have dependency assignments.

e.g. a = 10; b = a Support for cascading comparisons while keeping Python semantics.

e.g. if a < b < c < d >= e:

a = 1 Support for cascading assignments.

e.g. a = b = c = 9 Support for conditional expressions.

e.g. c = a if x > 3 else b Map value content and nesting levels are unrestricted and can take many forms, such as list, map, function, and call. String slice supports string[ :], string[ : end], and string[start: ]. Support for list comprehensions. Support for keyword assert. More strict function definition checks. Functions can be customized and imported, and any other function calls will report undefined errors. System calls and built-in functions both need to be imported. More syntax checking, such as number of function parameter, number mismatch, function redefinition and undefined variable, and so on. More precise syntax information for printing errors.

For details of supported built-ins, please refer to builtins.py. Implement a series of commonly used library functions

int, str, bytes2hexstring, hexstring2bytes, bytearray_reverse, split, list_remove_elt, elt_in

Please see the function and implementation in libont.py. Will support dict’s has_key, values, keys functions, and list remove function. Also, restore the semantics of global code (supports global writable variables, implementing cross-function shared variables). More in line with Python syntax, supporting more grammatical features.

Compiler Design Framework