USING PYCFORGE

Conversion and input limits

Use the input ranges, source forms, and memory requirements for the selected conversion mode.

During conversion

PyCForge reads submitted Python without running it. It does not import installed packages or open paths mentioned by the source. It emits C. Compilation is an explicit optional action through the Compile C dialog or your own C11 toolchain. Running the resulting program remains an external action.

Source and numeric limits

ItemLimitApplies to
Integer values and results−9,223,372,036,854,775,808 through 9,223,372,036,854,775,807.Both modes; Python's arbitrary-size integers do not carry over.
Source textDefault 1,000,000 bytes and 100,000 lines.Both modes, with additional token/AST work limits.
Included modules1–64 supplied modules in either mode.Runtime bundles need at least one top-level function; empty and constants-only companions are accepted.
Source nestingConfigured limit up to 128; runtime AST traversal also caps depth at 80.Simplify deeply nested syntax when rejected.
Fixed containers / record fields1–64 elements / fields.Typed conversion.
Module declarations / function parameters512 declarations / 64 parameters.Runtime conversion.
Local bindings / captured cells1,024 locals per function / 256 captured cells per closure.Runtime conversion.
Class definitionsUp to 64 fields and 64 distinct user methods across the complete single or multiple inheritance hierarchy, containing at most 64 distinct user classes including the subclass; object is additional.Runtime conversion.
File readDefault 1 MiB; configurable up to 16 MiB.Both modes; runtime consumption is cumulative per open handle. See file-workflow limits.

These are source, value, and file limits. Editing assistance, outline navigation, search results, and replacement batches have separate editor limits; a character count is not the same as a UTF-8 byte count.

Typed C caller requirements

Keep arithmetic within the admitted numeric range. String arguments must be non-null, NUL-terminated valid UTF-8 with no embedded NUL and byte length below INT64_MAX. Keep borrowed storage alive for every use. File-read results have separate allocation and status rules in Strings and memory in the C caller.

Runtime context requirements

Runtime strings use explicit byte lengths and allow embedded NUL. C callers supply valid UTF-8, finite floating values, and supported argument types. Use one context for connected values and always release it with pv_destroy.

Context resourceDefault bound
Total arena allocations64 MiB; retained until the context is destroyed.
Counted loop, materialization, and annotation-check work1,000,000 steps.
Nested calls128 levels.

These bounds are not a wall-clock or total-instruction limit. External builds can configure PYCF_RUNTIME_BYTES and PYCF_RUNTIME_STEPS. The C target requires a 64-bit host with binary64 double. See Runtime C use.

When a limit or check fails

A source-conversion failure reports a diagnostic and produces no new C. A previous successful output still describes the previous source. A runtime failure, such as overflow, invalid indexing, an annotation mismatch, or an exhausted context budget, sets the context error. Discard that result and destroy the context.

Check actual program inputs

Successful emission does not exercise every input. Review diagnostics, check the appropriate error channel, and compare C results with Python using representative and boundary inputs. Follow the conversion checklist.