bazel__book/starlark.md

1,004 B

Starlark

Official site

Differences with Python

Feature Python 3.x Starlark
Classes Supported Not supported (use struct or provider)
While loops Supported Not supported (only for loops)
I/O Full access (open, socket) None (cannot read files or network)
Global Reassignment Allowed Illegal (globals are constants after init)
Recursion Supported Illegal
Strings Iterable Not iterable (use s.elems() or s.codepoints())
Boolean Math True + 1 == 2 Error (Bools are not integers)