PYTHON 3.11 โ†’ DETERMINISTIC PORTABLE ISO C11

Start here

PyCForge is a bounded Python-to-C source transpiler with a desktop workspace, command-line interface, and structured Python API.

Application{{APPLICATION_VERSION}}Converter contract0.16.0
Source grammarPython 3.11TargetPortable ISO C11 source
Governing rule. PyCForge converts only what it can prove inside its declared static and resource-bounded contract. Unsupported input is rejected with diagnostics; it is not guessed at, partly published, or silently approximated.

Your first conversion

Save the following source as example.py:

def add(left: int, right: int) -> int:
    return left + right

In the workspace, open the file and choose Transpile Source Bundle (Ctrl+Return). From a terminal:

pycforge convert example.py --output example.c

A successful result contains a typed C prototype and definition using int64_t. Generated C is published only after the complete source bundle passes parsing, normalization, analysis, proof validation, C-IR validation, rendering, and conformance checks.

Install a downloaded source package on Windows

Use an isolated virtual environment. Substitute the actual archive location if it is not in the current PowerShell directory.

py -3.12 -m venv .venv
.\.venv\Scripts\python.exe -m pip install --upgrade pip
.\.venv\Scripts\python.exe -m pip install .\pycforge-1.0.4.tar.gz
.\.venv\Scripts\python.exe -m pycforge.ide

Verify the command surface and installed version:

.\.venv\Scripts\python.exe -c "import pycforge; print(pycforge.__version__)"
.\.venv\Scripts\pycforge.exe --help

For source review after extraction, create the environment beside the extracted directory and install the directory with python.exe -m pip install .. Keep review results separate from the original archive so its checksum remains meaningful.

Conversion inventory

FamilyAdmitted surfaceDetailed reference
Typed scalarsbool, signed 64-bit int, finite float, bounded strings, annotated top-level functions, assignments, returns, arithmetic, comparisonsTypes and expressions
Control flowReachability-aware conditionals, branch-defined scalar publication, while, positional range, fixed-container loops, break, continue, loop-elseControl flow and scope
Fixed dataHomogeneous local lists, tuples, dictionaries, numeric/Boolean sets, literal access, set membership, bounded ordered-container iteration, immutable automatic static recordsContainers and records
Calls and bundlesDirect calls, positional and supported keyword binding, required keyword-only parameters, selective cross-module imports, explicit 1โ€“64 document bundlesCalls, modules, and bundles
File effectsBounded whole-file UTF-8 reads, exact UTF-8 writes, sequential closed sessions, ownership transfer, cleanup, explicit generated-C status ABIFile I/O and C ABI
Conversion engineeringFive core Ting proof agents plus typed capability/resource binding, appendable roles, tested RuleSpecs, reproducible verified Compact-IR, indexed matching, and fail-closed shadow reviewTing conversion agents

Use this reference