Limitations
Pyle is small on purpose. These features are absent, and some are unlikely to be added.
Syntax and language
Section titled “Syntax and language”- No
switchorcase. - No ternary
a ? b : c. - No
try/catch. Usepcallfor catchable errors; uncaught panics halt execution. - No list or dict comprehensions.
- No generator expressions.
- No
withstatement. - No
delstatement. - No
isoperator. - No
matchor pattern matching. - No decorators.
- No
@property; struct getters and setters exist only through C++ bindings. - No multiple inheritance or interfaces.
- No f-strings. Use
format(). - No
**exponentiation. Usemath.pow(). - No
//integer division. - No
++or--. Usex += 1. - No
!for logical NOT. Usenot. - No
infor containment.inonly appears infor x in iterable. - No
not in. - No slice assignment
arr[1:3] = [...]. - No negative indices for arrays or strings.
- No default parameter values for Pyle functions.
- No runtime-enforced type hints.
Types and values
Section titled “Types and values”- Bitwise operators exist but require int operands.
- Strings are byte strings, not Unicode text. Multibyte UTF-8 is not character-aware.
- Strings support
==and!=, but not<,<=,>, or>=. - Division and modulo by zero raise. There is no
infornan. - Integer arithmetic wraps on overflow.
- Structs have a fixed shape. Fields cannot be added after construction.
- Struct operator overloading is not wired up. Only
_initis honored. - Map keys cannot be arrays, maps, struct instances, or
BytesBuilder. json.stringifyrejects struct instances.
Concurrency
Section titled “Concurrency”- No threads and no shared-memory parallelism. Coroutines are cooperative and single-threaded.
- No preemptive scheduling. A long-running script blocks its thread until it yields or finishes.
- The playground runs scripts in a worker and terminates them after 8 seconds.
Tooling and platform
Section titled “Tooling and platform”proc, worker processes, and.pyledmodules are unavailable onwasm32.json,http, andcryptoare not part oflibpyle.- The
workerPyle module requiresjson. - Async file and sleep operations resolve synchronously on
wasm32.
Compile-time restrictions
Section titled “Compile-time restrictions”breakandcontinueoutside a loop are compile errors.- Compound assignment on an index requires a simple index expression:
a[i] += 1is valid;a[x + 1] += 1is a syntax error. 1.is parsed as the integer1followed by field access. Write1.0.- Functions accept at most 255 parameters.
Pre-1.0 status
Section titled “Pre-1.0 status”Pyle is pre-1.0. Syntax and behavior can change between releases. Pin a commit if you embed it in something long-lived.
Related
Section titled “Related”- Notes for everyday syntax surprises.
- Types & Values for the value model.
- Bytecode & VM for the execution model.