GETTING STARTED
Select a mode by the Python features and C interface your program needs. Each column describes that mode's supported forms.
| Feature | Typed conversion | Runtime value conversion |
|---|---|---|
| Selection | Transpile → Typed, then Transpile; default CLI/API request. | Transpile → Runtime, then Transpile; CLI --runtime-values; API request_options(). |
| Source files | 1–64 supplied modules; direct function imports. | 1–64 supplied modules; function/class/constant imports, aliases, re-exports, and immutable module constants. |
| Function values and types | Annotated parameters and results; consistent scalar locals; direct calls and required keyword arguments. | Optional parameter/result annotations, unions, container types, first-class functions, bound methods, and lambdas; positional/keyword calls, defaults, positional-only and keyword-only parameters. |
| Strings | Runtime length, comparison, search, membership, prefix/suffix checks; additional constant-text operations. | Runtime construction, repetition, Unicode indexing/slicing, strip/lstrip/rstrip, lower/upper, split with maxsplit, join, replace, inspection, f-string precision/alignment, repr/ascii, format and str.format. |
| Lists and tuples | Fixed local homogeneous values; literal indexing and iteration. | Mixed and nested values, dynamic indices, slices, function arguments/results, and shared lists with item mutation, append/extend, insert/pop/remove, sort/reverse, copy/clear and index. |
| Dictionaries | Fixed local dictionaries. | Ordered mutable dictionaries, scalar/tuple keys, nested values, key lookup and deletion, get/setdefault, update, copy, pop/popitem, live views, and dictionary comprehensions. |
| Everyday builtins | Restricted documented scalar forms. | sum, min/max, abs, round, enumerate, zip, any/all, sorted, iter/next, and builtin function values. |
| Sets | Numeric/Boolean set membership. | Not supported. |
| Classes | Simple immutable records with numeric/Boolean fields. | Annotated mutable fields, constructors, ordinary methods, and shared instances. |
| Control flow | Branches, integer ranges with a literal nonzero step, fixed-container loops, break/continue, loop else. | Branches, sequence/range/dictionary/view and lazy iterator loops, conditional expressions, short-circuit values, break/continue, loop else. |
| List and dictionary comprehensions | Not supported. | Multiple generators, filters, dependent iterables, and fixed unpacking. |
| Files | Bounded UTF-8 read/write entry points for C callers. | UTF-8 read/process/write workflows across functions/modules; line iteration, sized reads, append, and automatic handle cleanup. See File-processing workflows. |
| C interface | Direct scalar function interfaces and documented file status/ownership rules; typed records remain local. | Tagged values and a caller-owned memory context. |
| Code inspection | Typed conversion validation and exact ForgeLens mappings. | Source diagnostics, generated-function names, and checked runtime operations; no exact ForgeLens mappings or typed C-IR validation. |
For typed conversion, start with Variables, types, and strings, then Branches and loops, Containers and records, and Functions and module variables.
For runtime value conversion, start with Runtime conversion and C use, then follow the string, container, class, function, and comprehension pages in order.
Integers use signed 64-bit values. General Python libraries, exceptions, asynchronous code, generators, reflection, inheritance, and writable module globals are outside these documented forms. Source conversion does not execute Python or build the C result.
Conversion success establishes that the source can be emitted for the selected mode. It does not exercise every runtime input. Check the mode's type, memory, and arithmetic requirements when calling generated functions.
Retain the Python source, selected mode, settings, and installed version alongside generated C. Check the version through Help → About or:
python -c "import pycforge; print(pycforge.__version__)"