A Python superset, that also includes system programming features.

They released a local Mac installation this week (2023-10-18) and I tried it out on my laptop. The VSCode extension is still a little buggy.

New language constructs learnt include:

Ownership Syntax

SyntaxNotesComments
inoutMutableThe reason it’s called this is because the mutations on the argument inside the function visible outside the function
borrowedImmutable referenceThe default semantic, and doesn’t need to be declared.
ownedOwnershipRust uses this as the default semantic.

Variable initialization

There are three ways to initialize a variable:

Initialization MethodSyntaxNotes
Python-stylex = 1To be used in def-declared functions only
Using letlet x = 1Denotes an immutable variable
Using varvar x = 1Denotes a mutable variable

Function Declaration

Declaration MethodNotes
defPython-style. No strict enforcement of types and internal variable declarations
fnRequires Mojo-type hints to be specified, and internal variable declarations to use either let or var.