{"slug": "ten-billion-lines-of-code-the-most-prolific-code-generator-before-copilot-2025", "title": "Ten Billion Lines of Code-The most prolific code generator before Copilot (2025)", "summary": "Quicktype, an open-source JSON-to-types code generator launched by Mark and a co-founder in July 2017, has generated more than ten billion lines of code, crossing one billion lines by its first birthday. The tool supports over 30 languages including TypeScript, Python, Go, Rust, Swift, Kotlin, Java, C#, C++, Haskell, Dart and Elm, using a three-stage read-simplify-render architecture that separates the type graph from language-specific renderers. The author built the first version to avoid hand-writing Swift JSON serialization boilerplate before Swift 4 and Codable existed.", "body_md": "**Ten billion lines of code**, and not one of them written by an LLM. That's a conservative count of what [quicktype](https://quicktype.io) has generated since 2017, when the most prolific programmer on the planet was arguably a small open-source tool that turned JSON into types. I built the first version because I was sick of writing Swift boilerplate by hand.\n\nMark and I [launched](https://quicktype.io/blog/first-look) quicktype in July 2017 to generate strongly-typed models and serializers from JSON. By its first birthday, we'd crossed a billion lines.\n\nIt supports over 30 languages—TypeScript, Python, Go, Rust, Swift, Kotlin, Java, C#, C++, Haskell, Dart, Elm, and more—each generating idiomatic, human-quality code. The architecture we built, with clean separation between the type graph and language-specific renderers, made it possible for the community to add many of these.\n\n## The Origin Story\n\nIn 2016, I was building a Swift app before Swift 4 and `Codable`. There was no nice way to serialize JSON—you had to write tedious boilerplate for every model type:\n\n``` js\nstruct User {\n    let name: String\n    let email: String\n    let age: Int\n\n    init?(json: [String: Any]) {\n        guard let name = json[\"name\"] as? String,\n              let email = json[\"email\"] as? String,\n              let age = json[\"age\"] as? Int else {\n            return nil\n        }\n        self.name = name\n        self.email = email\n        self.age = age\n    }\n\n    func toJSON() -> [String: Any] {\n        return [\"name\": name, \"email\": email, \"age\": age]\n    }\n}\n```\n\nEvery time I changed my data model, I had to update serialization methods by hand. *This is a job for computers.*\n\nI hacked together a prototype—paste JSON, get Swift structs—and showed it to Mark. He had deep expertise in type systems and compilers, and saw immediately that this wasn't just string munging. How do you infer the best types from sample data? How do you handle heterogeneous arrays? How do you know when an object is really a dictionary?\n\nThe premise was simple: paste JSON, get type-safe code. The execution required solving some surprisingly deep computer science problems.\n\n## The Architecture: Read, Simplify, Render\n\nquicktype processes JSON in three stages, like a compiler (see [quicktype Under the Hood](https://quicktype.io/blog/under-the-hood) for the deep dive):\n\n**Read**: Parse JSON and infer an initial **type graph**. Each unique structure becomes a node—an array of objects creates an `Array` type containing a `Class` type.\n\n**Simplify**: Optimize the type graph. Create union types when the same position can contain different types (`[1, \"1\"]` → `Array<Int | String>`). Merge equivalent types. Detect maps vs. objects using a Markov chain (more on this below).\n\n**Render**: Convert the type graph to source code. Each language has its own renderer handling naming conventions, serialization, type syntax, and imports.\n\nThis architecture made it easy to add languages—just implement a new Renderer. That's how we went from 2 languages at launch to over 30.\n\n## Little Big Details\n\nWe called these \"[Little Big Details](https://quicktype.io/blog/little-big-detail-1)\"—the subtle niceties that make quicktype's output look human-written.\n\n### Property Names\n\nJSON property names come in all shapes:\n\n```\n{\n  \"user_name\": \"alice\",\n  \"firstName\": \"Alice\",\n  \"LAST-NAME\": \"Smith\",\n  \"EmailAddress\": \"alice@example.com\"\n}\n```\n\nquicktype detects naming styles, splits names into words, reconstructs them in the target language's convention, and generates mapping code when needed. For Swift:\n\n``` js\nstruct User: Codable {\n    let userName: String\n    let firstName: String\n    let lastName: String\n    let emailAddress: String\n\n    enum CodingKeys: String, CodingKey {\n        case userName = \"user_name\"\n        case firstName\n        case lastName = \"LAST-NAME\"\n        case emailAddress = \"EmailAddress\"\n    }\n}\n```\n\n### Contextual Class Names\n\nConsider this JSON:\n\n```\n{\n  \"user\": {\n    \"address\": { \"street\": \"123 Main St\", \"city\": \"Springfield\" }\n  },\n  \"company\": {\n    \"address\": {\n      \"street\": \"456 Business Ave\",\n      \"city\": \"Commerce City\",\n      \"suite\": \"100\"\n    }\n  }\n}\n```\n\nBoth have an `address` with different structures. A naive approach names both `Address` and causes conflicts. quicktype uses **contextual naming**:\n\n```\ninterface User {\n  address: UserAddress;\n}\n\ninterface UserAddress {\n  street: string;\n  city: string;\n}\n\ninterface Company {\n  address: CompanyAddress;\n}\n\ninterface CompanyAddress {\n  street: string;\n  city: string;\n  suite: string;\n}\n```\n\nPrefixes are only added when necessary.\n\n### Detecting Maps with Markov Chains\n\nMy favorite innovation (I wrote a [blog post about it](https://quicktype.io/blog/markov)). Consider this Bitcoin blockchain data:\n\n```\n{\n  \"000000000000000000c846dee2e13c6408f5\": {\n    \"hash\": \"000000000000000000c846dee2e13c6408f5\",\n    \"height\": 503162,\n    \"time\": 1515187634\n  },\n  \"00000000000000000024fb37364cbf81fd95\": {\n    \"hash\": \"00000000000000000024fb37364cbf81fd95\",\n    \"height\": 503163,\n    \"time\": 1515188162\n  }\n}\n```\n\nA naive translation would create a class with properties like `the000000000000000000C846Dee2E13C6408F5`—clearly wrong. A human would immediately recognize this as a `Map<String, Block>`.\n\nHow? The property names don't look like property names—they look like data. We quantified this intuition with a **Markov chain** trained on typical property names. The chain models character sequence probabilities: `qu` → `i` is high probability, `qu` → `x` is near zero.\n\nquicktype scores each property name against this model. Names like `firstName` score high; hashes score near zero. Below a threshold, it generates a map:\n\n``` js\ntypealias Blocks = [String: Block]\n\nstruct Block: Codable {\n    let hash: String\n    let height: Int\n    let time: Int\n}\n```\n\n## Multiple Samples for Better Types\n\nA single JSON sample might not represent all possible values ([more details](https://quicktype.io/blog/quicktype-multiple-samples)). Provide two samples:\n\n```\n// Sample 1: User is online\n{ \"name\": \"Alice\", \"status\": \"online\", \"lastSeen\": null }\n\n// Sample 2: User is offline\n{ \"name\": \"Bob\", \"status\": \"offline\", \"lastSeen\": \"2018-03-08T10:30:00Z\" }\n```\n\nAnd quicktype correctly infers `lastSeen: string | null` by merging type graphs from all samples.\n\n## TypeScript as a Schema Language\n\nYou can write TypeScript type definitions and use them as input:\n\n```\ninterface Person {\n  name: string;\n  nickname?: string; // an optional property\n  luckyNumber: number;\n}\n```\n\nTypeScript is more readable than JSON Schema, making it an excellent \"schema language\":\n\n```\nquicktype pokedex.json -o pokedex.ts --just-types  # Infer types from JSON\nquicktype pokedex.ts -o src/ios/models.swift       # Generate Swift from TypeScript\n```\n\n## Cross-Language Type Conversion\n\nquicktype can also [read source files from one language](https://quicktype.io/blog/swift-types-from-csharp) and generate equivalent types in another:\n\n```\nquicktype --src-lang csharp Models.cs -o Models.swift\n```\n\n## What We Learned\n\n**Most developers don't know JSON.** We expected valid JSON. We got trailing commas, single quotes, unquoted keys, comments, JavaScript objects. We built increasingly sophisticated error recovery to handle the garbage people pasted in.\n\n**Details matter.** Property naming, contextual class names, map detection—these made quicktype feel magical. Generated code that looks human-written encourages adoption.\n\n**Meet developers where they are.** The web app was a great demo, but adoption exploded with CLI and IDE integrations.\n\n**Open source works.** The Rust, Kotlin, and Python renderers came from contributors. We couldn't have built 30+ languages ourselves.\n\n## Why quicktype Still Matters\n\nIn the age of Copilot and ChatGPT, quicktype does something LLMs struggle with: **the more data you give it, the better it understands your schema**. Feed quicktype a hundred JSON samples and it produces more accurate types. Feed an LLM a hundred samples and it will hit context limits or hallucinate properties.\n\nquicktype is deterministic. Same input, same output. It doesn't guess—it infers types through principled algorithms. That predictability matters for production code.\n\nGive it a spin at [quicktype.io](https://quicktype.io), or contribute on [GitHub](https://github.com/glideapps/quicktype).", "url": "https://wpnews.pro/news/ten-billion-lines-of-code-the-most-prolific-code-generator-before-copilot-2025", "canonical_source": "https://www.dvdsgl.co/2025/quicktype-retrospective", "published_at": "2026-10-11 17:04:46+00:00", "updated_at": "2026-10-11 17:30:27.202550+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools"], "entities": ["quicktype", "Mark", "Swift", "TypeScript", "Python", "Go", "Rust", "Kotlin"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/ten-billion-lines-of-code-the-most-prolific-code-generator-before-copilot-2025", "markdown": "https://wpnews.pro/news/ten-billion-lines-of-code-the-most-prolific-code-generator-before-copilot-2025.md", "text": "https://wpnews.pro/news/ten-billion-lines-of-code-the-most-prolific-code-generator-before-copilot-2025.txt", "jsonld": "https://wpnews.pro/news/ten-billion-lines-of-code-the-most-prolific-code-generator-before-copilot-2025.jsonld"}}