Anchor requires Python 3.9 or later
Install the latest release from The Python Package Index (PyPI):
pip install anpl
Run the following commands in order:
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
python3 -m build
pip install ./dist/anpl-<version>.tar.gz --force-reinstall
Run the Anchor compiler:
an [option] [file]
an --help
for more information
This is an example of the Anchor code to print Hello, World!
:
print("Hello, World!");
This is an example of the Anchor code to define a class:
class MyClass
begin
property x: Integer;
method MyClass() -> MyClass
begin
this.x = 0;
this.printSomething();
return this;
end
method MyClass(x: Integer) -> MyClass
begin
this.x = x;
return this;
end
method printSomething() -> Null
begin
print("this is a private method");
end
end
This is an example of the legacy function definition to return a string:
function myFunc() -> String
begin
return "a legacy function";
end
I am excited to work alongside you to build and enhance Anchor Programming Language!
BEFORE you start work on a feature/fix, please read and follow the Contributor's Guide to help avoid any wasted or duplicate effort.
This project has adopted the Contributor Covenant Code of Conduct. For more information contact luo@jiahai.co with any additional questions or comments.