Project status

Status and roadmap

Typhon is a proof of concept whose code is mostly generated by AI. This page describes the principles behind it, what has been verified, and the ideas for its next steps.

Last updated 2026-11-24

Current state

Typhon is a proof of concept. It compiles a subset of Python, and a test harness checks its results against CPython, using existing programs and libraries. Expect missing features and bugs. The project gives no stability or support promises. The language, the command line and the generated code can change with any commit.

Principles behind the code

Most of Typhon’s code is generated by AI. A person defined the core principles and ideas, and the AI implemented the compiler, the runtime, the tools and the tests from them. These principles shape every part of the project:

  • Typhon source is valid Python syntax. Python editors, formatters and linters work on .ty files, and the same file can run under CPython for comparison.
  • Static types come from annotations or from whole-program inference. dynamic stays available as an explicit escape hatch.
  • The compiler generates C# and lets Roslyn produce the IL, so Typhon and C# code share one compilation and one assembly.
  • Python’s protocols map to their .NET counterparts, and Typhon objects behave like native .NET objects in C#.

The principles and their costs are explained in Design decisions.

Verification so far

The repository contains two kinds of evidence about Typhon’s behaviour. The conformance suite compares Typhon’s output with CPython’s for 656 small programs. Under typhon run, 654 of them match byte for byte. In the last Native AOT pass, which covered 17 of them, 10 matched. CI runs the suite on Windows and Linux. The benchmark runs compared the output of every program under every tool, and all results matched CPython’s.

Compiling CPython’s standard library

Typhon’s standard library survey compiles the same 128 single-file modules from CPython 3.15.2. The latest complete development survey compiled all 128 modules with zero compiler errors. That build also passed the Playground and NumPy suites and matched the output of all 24 reference programs. An intermediate build reported one diagnostic in a Tkinter callback used by Turtle. The repaired callback matches CPython with both its captured receiver and a replacement receiver. The last survey of a published compiler, at commit bb49076, recorded 121 clean modules and 317 compiler errors. The conformance suite compares runtime behaviour with CPython.

Modules that compile, of 128
Compiler errors over all modules

published on main latest survey, work in progress

The line connects every survey. Hover over a chart, or focus it and use the arrow keys, to read a survey.

Exact survey counts
SurveyTime (CET)Modules that compileCompiler errorsState
1 21 Nov, 23:54 15 7,117 Work in progress
2 22 Nov, 00:32 20 7,132 Published on main (7bbb77e)
3 22 Nov, 07:39 20 7,295 Work in progress
4 22 Nov, 08:16 25 6,307 Work in progress
5 22 Nov, 08:26 25 6,130 Work in progress
6 22 Nov, 08:33 28 6,132 Work in progress
7 22 Nov, 08:52 28 6,132 Work in progress
8 22 Nov, 09:18 28 6,132 Work in progress
9 22 Nov, 09:25 29 5,682 Work in progress
10 22 Nov, 09:38 31 5,612 Work in progress
11 22 Nov, 09:48 32 5,480 Work in progress
12 22 Nov, 09:54 33 5,452 Work in progress
13 22 Nov, 10:13 33 5,414 Work in progress
14 22 Nov, 10:23 36 5,273 Work in progress
15 22 Nov, 10:25 36 5,273 Published on main (8a8a3bd)
16 22 Nov, 10:54 38 4,965 Work in progress
17 22 Nov, 11:14 38 4,965 Published on main (5fcf946)
18 22 Nov, 11:36 43 4,424 Work in progress
19 22 Nov, 12:03 48 4,283 Work in progress
20 22 Nov, 12:30 48 4,283 Published on main (e04b695)
21 22 Nov, 12:32 52 3,965 Work in progress
22 22 Nov, 13:00 50 3,980 Work in progress
23 22 Nov, 13:10 56 3,623 Work in progress
24 22 Nov, 13:39 57 3,531 Work in progress
25 22 Nov, 13:45 57 3,531 Work in progress
26 22 Nov, 14:03 58 3,529 Published on main (66c20a8)
27 22 Nov, 14:11 61 3,238 Work in progress
28 22 Nov, 14:54 61 2,960 Published on main (5d6efd6)
29 22 Nov, 15:17 62 2,853 Work in progress
30 22 Nov, 15:35 61 2,946 Work in progress
31 22 Nov, 15:38 62 2,797 Published on main (4998289)
32 22 Nov, 16:07 64 2,714 Work in progress
33 22 Nov, 16:13 63 2,754 Work in progress
34 22 Nov, 16:27 65 2,674 Work in progress
35 22 Nov, 16:38 67 2,605 Work in progress
36 22 Nov, 16:52 67 2,587 Work in progress
37 22 Nov, 17:11 67 2,253 Work in progress
38 22 Nov, 17:39 69 2,162 Work in progress
39 22 Nov, 17:45 70 2,121 Work in progress
40 22 Nov, 18:13 70 2,134 Work in progress
41 22 Nov, 18:21 72 2,058 Work in progress
42 22 Nov, 18:41 70 2,126 Published on main (43f1f86)
43 22 Nov, 18:44 73 2,013 Work in progress
44 22 Nov, 18:46 73 1,978 Work in progress
45 22 Nov, 19:04 73 1,968 Work in progress
46 22 Nov, 19:19 73 1,884 Work in progress
47 22 Nov, 19:47 73 1,860 Work in progress
48 22 Nov, 19:55 73 1,858 Work in progress
49 22 Nov, 20:49 73 1,838 Work in progress
50 22 Nov, 21:01 73 1,834 Work in progress
51 22 Nov, 21:24 72 1,810 Work in progress
52 22 Nov, 21:55 73 1,801 Work in progress
53 22 Nov, 22:53 73 1,786 Published on main (bd709d1)
54 22 Nov, 23:29 73 1,782 Work in progress
55 23 Nov, 00:00 73 1,779 Work in progress
56 23 Nov, 00:17 74 1,761 Work in progress
57 23 Nov, 00:39 74 1,742 Work in progress
58 23 Nov, 00:51 74 1,760 Work in progress
59 23 Nov, 01:03 74 1,758 Work in progress
60 23 Nov, 01:14 73 1,787 Work in progress
61 23 Nov, 01:45 74 1,755 Work in progress
62 23 Nov, 01:59 74 1,753 Work in progress
63 23 Nov, 02:20 74 1,740 Work in progress
64 23 Nov, 02:28 73 1,743 Work in progress
65 23 Nov, 02:41 74 1,742 Work in progress
66 23 Nov, 02:50 77 1,720 Published on main (4ef9532)
67 23 Nov, 03:19 79 1,638 Work in progress
68 23 Nov, 03:27 80 1,635 Work in progress
69 23 Nov, 04:03 80 1,635 Published on main (db2e930)
70 23 Nov, 04:19 82 1,496 Work in progress
71 23 Nov, 04:48 83 1,477 Work in progress
72 23 Nov, 04:52 87 1,363 Work in progress
73 23 Nov, 05:22 87 1,363 Published on main (1cba51f)
74 23 Nov, 05:37 91 1,138 Work in progress
75 23 Nov, 06:18 95 1,101 Work in progress
76 23 Nov, 06:26 96 1,070 Work in progress
77 23 Nov, 07:02 100 1,054 Work in progress
78 23 Nov, 07:20 100 1,054 Published on main (fba5d39)
79 23 Nov, 08:03 101 1,046 Work in progress
80 23 Nov, 08:13 103 879 Published on main (13f715a)
81 23 Nov, 09:20 103 873 Work in progress
82 23 Nov, 09:23 105 815 Work in progress
83 23 Nov, 10:34 106 769 Work in progress
84 23 Nov, 10:58 108 745 Work in progress
85 23 Nov, 11:38 110 672 Work in progress
86 23 Nov, 11:52 111 650 Work in progress
87 23 Nov, 12:31 115 525 Work in progress
88 23 Nov, 13:03 115 525 Published on main (106cf11)
89 23 Nov, 13:24 118 430 Work in progress
90 23 Nov, 13:39 118 358 Work in progress
91 23 Nov, 14:28 118 355 Work in progress
92 23 Nov, 14:57 119 332 Work in progress
93 23 Nov, 15:24 120 330 Work in progress
94 23 Nov, 16:04 121 317 Work in progress
95 23 Nov, 16:24 121 316 Work in progress
96 23 Nov, 16:46 121 312 Work in progress
97 23 Nov, 18:09 121 317 Published on main (bb49076)
98 23 Nov, 18:17 117 317 Work in progress
99 23 Nov, 18:39 122 306 Work in progress
100 23 Nov, 19:19 122 277 Work in progress
101 23 Nov, 19:41 121 301 Work in progress
102 23 Nov, 20:36 122 254 Work in progress
103 23 Nov, 20:52 121 239 Work in progress
104 23 Nov, 21:25 121 225 Work in progress
105 23 Nov, 21:28 122 223 Work in progress
106 23 Nov, 21:46 122 95 Work in progress
107 24 Nov, 00:08 119 42 Work in progress
108 24 Nov, 01:03 127 1 Work in progress
109 24 Nov, 02:14 128 0 Work in progress
110 24 Nov, 02:22 128 0 Work in progress
111 24 Nov, 02:30 127 1 Work in progress
112 24 Nov, 02:48 127 1 Work in progress
113 24 Nov, 02:51 127 1 Work in progress
114 24 Nov, 02:54 127 1 Work in progress
115 24 Nov, 03:11 127 1 Work in progress
116 24 Nov, 03:36 128 0 Work in progress
117 24 Nov, 04:21 128 0 Work in progress
118 24 Nov, 04:46 128 0 Work in progress
119 24 Nov, 05:16 128 0 Work in progress
120 24 Nov, 05:46 128 0 Work in progress
121 24 Nov, 06:07 128 0 Work in progress
122 24 Nov, 06:37 128 0 Work in progress
123 24 Nov, 07:07 128 0 Work in progress
124 24 Nov, 07:37 128 0 Work in progress

The same build also matched CPython in all 128 original-source startup checks. The checks import each module and compare its reported module name and the presence of source file metadata. They use arbitrary-precision integers for ipaddress, typing and uuid. The antigravity check uses a local browser stand-in and the site check uses a temporary path fixture.

Recent development checks also ran original CPython source. The HTTP server matched CPython when parsing an in-memory GET request and when rejecting an unsupported HTTP version. Bundled Tkinter matched a headless Tcl expression and variable round trip using five unchanged CPython files with their original license. Original smtplib matched a complete local SMTP transaction with CPython across all 12 lines of the exchange. The check covered ESMTP options, an accepted and a refused recipient, message formatting, dot stuffing, and closing the connection. The managed TLS backend ran a loopback client through unchanged ssl.py and matched CPython on certificate verification, ALPN, and encrypted data exchange. Unchanged enum.py matched the focused checks for iteration, aliases, integer enums, and string enums. Original pdb.py matched alias creation, alias removal, and missing-command help. Unchanged turtle.py compiled with bundled Tkinter. A fresh headless run on the repaired build matched CPython for vector magnitude, addition, multiplication, and rotation. The original mailbox.py Maildir and mbox checks matched CPython when adding, replacing, reopening, and removing messages. Unchanged pydoc.py matched CPython for complete function signatures in plaintext, class documentation and method resolution order, module hierarchies, and the help object representation. Original doctest found and ran examples in modules, functions, and classes. The original filecmp directory comparison matched the expected common, left-only, and equal files.

Focused checks on the next development build matched CPython for line coverage in original trace and tuple and Unicode string selection in original secrets. The trace fix lets inferred class types survive module boundaries. The random fix uses Python sequence operations and resolves overloads for captured methods.

Original modulefinder matched CPython for nested imports, package-relative imports and missing dependencies, using both versions of dis. Source inspection uses the same bytecode bridge as py_compile. Original bisect matched keyed searches and insertion, bounds, and both public aliases.

Original typing loads the collections ABC source used by CPython. The module, List and Optional metadata matched CPython in arbitrary-precision mode. The original HMAC update() call returned None in a value expression. The same call handling also passed focused checks for typed instance methods, descriptors, and super().

Original tracemalloc matched CPython for byte allocation tracking, tracebacks and snapshot statistics in both integer modes. Typed sorting now preserves the Python callable passed as a key, and source indexers receive negative Python integers.

The follow-up compiler matched pinned CPython on original multipart email decoding, including a UTF-8 subject, a quoted-printable body, and a binary attachment. Its shared call binder preserves exact inferred signatures and handles ambiguity across source function overloads. Additional original-source fixtures matched for netrc with pathlib.Path, typed IMAP dates in both integer modes, and fnmatch with supplementary Unicode character ranges. The compiler repeated both 128-module checks with those changes combined. Every source compiled without errors and every startup comparison matched CPython.

A side-by-side gzip read check used the same Python import and call site for the managed backend and the original CPython source compiled to .NET. Both returned the same 16,373 decoded bytes as CPython. A separate check matched compression and decompression behaviour for one-shot operations in both implementations.

A second .NET comparison used the same Base64 call site with the managed backend and compiled CPython source. Both produced the same encoded and decoded bytes as CPython for the 8,198-byte input. In one interleaved local run, 400 warm round trips took a median 129 ms for the managed backend and 231 ms for the compiled original. Each backend had 20 timed samples while other tests ran on the same machine.

Roadmap ideas

The repository lists the following ideas for next steps. They have no schedule, and the project has not committed to any of them.

  • Annotations of the form A | B could compile to C# 15 union types, with one generated union per set of member types.
  • Tuple returns for out and ref parameters.
  • A faster big-int mode with a hybrid integer, which uses 64 bits and switches to BigInteger only on overflow.
  • decimal with a precision context, doctest that runs its examples, and more of CPython’s pure-Python standard library compiled with Typhon.
  • The conformance suite could grow, for example with relevant parts of CPython’s own test suite.
  • A dotnet tool package of the CLI with platform-specific ReadyToRun packages.
  • The Linux benchmark could run again with type inference, since the untyped N-body row there predates it.
  • sum(...) and any(...) over generator expressions compiled to loops instead of LINQ.
  • A fully static Typhon.NumPy API without dynamic return values, so that every NumPy program compiles with Native AOT.
  • NumPy expressions such as np.sqrt(x) * 2.0 - x / 3.0 could reuse or fuse their temporary arrays. In the benchmarks, such temporaries caused Typhon’s highest memory use, up to five times NumPy’s peak.
  • A dedicated MSBuild SDK, dotnet new templates and a language server built on the Typhon front end.
  • Selected standard library modules could get a second implementation, written in Typhon and calling .NET where .NET provides the operation. Typhon’s import resolver would choose the implementation per module without changes to the importing code. The same conformance cases would compare both implementations with CPython, and benchmarks would measure where each one is faster.
  • The CPython sources that Typhon ships could stay pinned to one CPython release, and each unchanged file would keep CPython’s attribution and full license in its header.

License

Typhon is released under the MIT License, the license of .NET itself. The Typhon runtime is compiled into every Typhon assembly and is covered by the same license. The CPython modules that Typhon ships as source keep CPython’s license, which each of these files contains in its header. Code generated from your .ty files belongs to you.