USING PYCFORGE
Use the input ranges, source forms, and memory requirements for the selected conversion mode.
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.
| Item | Limit | Applies 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 text | Default 1,000,000 bytes and 100,000 lines. | Both modes, with additional token/AST work limits. |
| Included modules | 1–64 supplied modules in either mode. | Runtime bundles need at least one top-level function; empty and constants-only companions are accepted. |
| Source nesting | Configured limit up to 128; runtime AST traversal also caps depth at 80. | Simplify deeply nested syntax when rejected. |
| Fixed containers / record fields | 1–64 elements / fields. | Typed conversion. |
| Module declarations / function parameters | 512 declarations / 64 parameters. | Runtime conversion. |
| Local bindings / captured cells | 1,024 locals per function / 256 captured cells per closure. | Runtime conversion. |
| Class definitions | Up 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 read | Default 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.
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 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 resource | Default bound |
|---|---|
| Total arena allocations | 64 MiB; retained until the context is destroyed. |
| Counted loop, materialization, and annotation-check work | 1,000,000 steps. |
| Nested calls | 128 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.
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.
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.