Python vs TypeScript: Which One for AI?

summarized

TLDR

Python dominates AI model training, fine-tuning, evaluation, and research, while TypeScript leads in AI product development, agent loops, and streaming interfaces. The two languages have stopped competing for the same job, with Python for the backend and TypeScript for the frontend of AI applications. Plain JavaScript is the casualty, losing to TypeScript in the AI era due to the reliability benefits of typed languages for AI-generated code.

Key points

  • Python's TIOBE index decline is misleading because it measures search engine hits, not actual code usage.
  • Package installs show Python vastly outpaces JavaScript for AI libraries like PyTorch, Hugging Face Transformers, and OpenAI client.
  • GitHub contributor counts in August 2025 show TypeScript surpassing Python, driven by AI-assisted coding favoring typed languages.
  • TypeScript's compiler checks improve reliability of AI-generated code, creating a convenience loop that reinforces TypeScript usage.
  • TypeScript version 7 rebuilt in Go reduces type-checking time by 10x, removing a major pain point.
  • WebGPU enables running models in-browser with transformers.js, favoring TypeScript for client-side AI inference.
  • Python wins in model training and research; TypeScript wins in product and agent interfaces.
  • Plain JavaScript is losing to TypeScript in the AI era, as typed languages become essential for AI-generated code reliability.

Tools mentioned

Techniques

  • TIOBE ranking methodology
  • GitHub contributor counting
  • Package install tracking
  • AI-assisted coding
  • Typed languages for reliability
  • Convenience loop in AI code generation
  • WebGPU inference
  • Model context protocol
  • Free-threaded Python
  • Lazy imports
  • JIT compilation
Transcript (captions)
Two numbers, both from this month. Python just took its worst yearly fall on the TIOBE index, down eight points. And it isn't one bad month. Python was at 27% last July, 22 by February, 18.9 now. JavaScript sits in sixth place on that same index, 2.72% and still sliding downward. On the ranking that gets quoted in most articles about languages, the two biggest languages in software look finished. In the exact same 12 months, both set records on GitHub. The highest contributor count either has ever posted. Both are true at once, and that contradiction is the clearest view of how AI is splitting these two apart. Start with why the ranking is wrong. TIOBE doesn't count code. It counts search engine hits for a language's name. For 25 years that worked fine. If you wrote Python on a Tuesday, you Googled Python 40 times before lunch. Then the behavior it tracks stopped. Stack Overflow peaked near 200,000 questions a month back in 2014. In the first five days of January this year, the whole site logged about 300 questions. Not 300,000, 300. That's down about 78% since ChatGPT launched. By last May, the site was posting volumes it had last seen in 2009. They didn't stop being asked. They moved into a chat window, which leaves no page, no link, nothing to crawl. So a search ranking now measures one thing well, how often a language confuses somebody enough to make them leave their editor. TIOBE's Paul Jansen defended the method again in March. His argument is that search still tracks interest. The volume data disagrees with him. That's a fine metric. It just isn't popularity. If you want to know what's being written in 2026, count installs and count contributors. So here's the week ending July 30th, pulled straight from the registries. PyTorch, 21.7 million installs in 7 days. Hugging Face Transformers, the library almost every open model ships against, pulled 43.4 million that same week. Hugging Face ships a JavaScript build of that same library. It pulled 1.8 million. Same library, 23 to 1. OpenAI's Python client pulled 97.7 million. The identical client on NPM pulled 31.8 million, roughly 3 to 1. Anthropic's SDK leans the same way, though not as hard. 45.1 million on PyPI against 28.8 million on NPM. That gap tracks something physical. It's where models get made and where the code that touches raw weights still lives, and it doesn't stop at training. The servers that run models in production, vLLM and SGLang, are Python on the outside with C++ and CUDA kernels underneath. Python is a control plane for the most expensive hardware in the building. GitHub's own numbers agree. 582,000 AI repositories written in Python last year, up 50% in 12 months. Jupyter notebooks turned up in 2.42 million repos, up 75% in 1 year. That's the sound of a research language growing. Even the file format tells the story. SafeTensors, the way most new open models ship their weights, was handed to the PyTorch Foundation in April. IEEE Spectrum ranked Python first overall for 2025 and first in its jobs ranking. The first year Python topped what employers were actually hiring for. JavaScript, on that same list, fell from third to sixth. Stanford's AI index found Python named in 258,000 US job postings, up almost 30% on 2024 alone, and the language is still moving fast. Python 3.14 shipped last October and made the free-threaded build officially supported. The global interpreter lock is optional now, after 30 years of people insisting it never would be. 3.15 lands on October 1st with lazy imports, a stable free-threaded ABI, and a faster JIT. Whatever this is, it isn't a language coasting. So, Python wins, and we're done 4 minutes in. Except that in August 2025, GitHub's contributor count put a new language on top and Python wasn't it. GitHub counts distinct contributors per language per month. That August, TypeScript hit 2,636,000. For scale, GitHub crossed 180 million developers last year and 36 million of them signed up in 2025 alone. Python, 2,585,000. About 50,000 apart with Python in second after 16 straight months on top. JavaScript came third at 2.16 million. The language that named the ecosystem now behind a superset of itself. Here's the fair counterpoint. On Stack Overflow's own survey, JavaScript is still the most used language on Earth at 66% ahead of Python at 58. By headcount, JavaScript hasn't lost a thing, but the growth rates are the louder number. TypeScript up 67% in a year, Python up 49, JavaScript up 25, and GitHub's stated reason is what makes this a story about AI rather than about fashion. Typed languages make agent-assisted coding more reliable in production. Look at what an assistant actually does when it writes code. It guesses a function signature, a return shape, a field name. In TypeScript, the compiler checks that guess before a single line runs. In Python, you find out at runtime. In front of a user if you're lucky, in a log at 3:00 in the morning if you're not. There's a second dollar reason that matters just as much. Next.js, Astro, Remix, SvelteKit, the frameworks people start projects in now scaffold TypeScript by default. You get handed types before you write a line. InfoQ put a name on what happens next, a convenience loop. The assistant is better at TypeScript, so people write more TypeScript, so the next model trains on more TypeScript, so the assistant gets better at it again. Which means that AI era is picking a language by momentum, not by merit. It compounds whichever one it already handled best at the speed of a model release cycle. You can watch that compounding land. Vercel's AI SDK pulled 19.4 million NPM installs last week from a package that barely existed 3 years ago. GitHub counted 1.1 million public repositories importing an LLM SDK last year, up 178%. Most of those aren't research code. They're products, and products get written where the interface lives. The cleanest test is model context protocol, the standard for how a model calls a tool, because Anthropic shipped the Python SDK and the TypeScript SDK on the same day. Neither side got a head start. Last week that was 79.6 million Python installs against 49.4 million TypeScript. Python still leads, but that is not the gap of a language with a monopoly on agents. Both SDKs have now passed a billion downloads each. The layer that decides how models use tools was built bilingual on purpose. Then check what the AI labs write their own tools in. Claude code is TypeScript, running React inside your terminal. OpenAI's Codex CLI started in TypeScript and moved to Rust for startup speed. That repo is about 96% Rust now. It left for performance, not for Python. And on July 8th, TypeScript removed its own biggest complaint. Version 7 shipped with the entire compiler rebuilt in Go. Type checking the VS Code code base went from 125.7 seconds to 10.6. Opening a file and seeing your first error, 17 and a half seconds, down to under 1.3. And it wasn't one lucky repository. Sentry went from 140 seconds to 16. Bluesky, 24 seconds down to under three. The tax you paid for having types got cut by roughly 10 times in the same year the assistant started depending on them. That timing is not a coincidence. There's one more shift underneath all of this, and it's the one that decides the next 5 years. Where does inference actually happen? In January, WebGPU finished shipping across Chrome, Edge, Firefox, and Safari. Every major browser can talk to the GPU directly now, which ended a 15-year era of WebGL workarounds. transformers.js takes a Hugging Face model, converts it to ONNX, and runs it in a tab. No server, no API key, and the data never leaves the machine. Quantized models under 2 GB now run at interactive speed on a normal laptop. 70 to 80% of native throughput inside a browser tab. Python has an answer here, and it's a real one. Pyodide compiles CPython to WebAssembly, and JupyterLite runs on top of it. But to get there, you are shipping an entire interpreter down the wire first. NumPy, Pandas, SciPy, and scikit-learn have all been ported, so the scientific stack really does run inside a browser tab. That's a teaching environment in a notebook, and it's excellent at being those. It is not the runtime you put in front of 10 million users. The client is somewhere Python can visit, not somewhere it lives. So, which one wins the AI era? The numbers give a clean answer, and it isn't a diplomatic draw. Python wins the model training, fine-tuning, evaluation, serving, research. PyTorch and Transformers aren't being displaced by anything on the JavaScript side, and the install gap isn't close to closing. TypeScript wins the product. The agent loop, the tool calls, the streaming interface, the thing a user stump actually touches, which leaves one real casualty, and it isn't the one the title points at. Plain, untyped JavaScript. JavaScript lost first place inside its own ecosystem to a superset of itself for one specific reason. When a machine writes most of your code, a compiler that checks the machine is worth far more than the keystrokes it cost you. So, the practical version. If you're building or tuning models, it's Python, and it isn't close. If you're building the application wrapped around a model, it's TypeScript, and increasingly not JavaScript. The versus framing was the wrong question all along. These two stopped competing for the same job somewhere around 2023, and a lot of the internet still hasn't updated its priors. If you're picking one to learn this year, pick the layer you want to work in first, then learn the language that layer already speaks. That decision has been made for you. The ranking will keep reporting that both languages are in decline. The registries publish the truth every Monday morning, and it says the opposite.

Frontier News · by Hyperjump Technology