"Two languages. One mind. One codebase."
The sibling quest
This Quest was designed as the frontend half of a pair. Python Quest is the backend half. Same shape (17 tracks, ~93 lessons), same goal (become a source-reader of cwkPippa), same voice. Each can be walked independently; the pair is the lingua franca duo.
What translates directly
- List comprehension ↔ array map/filter.
[x*2 for x in arr if x > 0]in Python,arr.filter(x => x > 0).map(x => x*2)in TS. Same operation, different syntax. - Type hints ↔ TS annotations. Python's
def f(x: int) -> strisfunction f(x: number): string. The semantics differ (Python's are advisory at runtime; TS's are checked at compile time), but the syntax intent is the same. - Protocols ↔ structural typing. Python's
typing.Protocolis duck typing made explicit, just like TypeScript's structural matching. - Discriminated unions ↔ tagged unions. Same pattern. Python uses Literal types + isinstance / match; TypeScript uses literal types + typeof / switch.
- async/await. Identical syntax, slightly different semantics (Python's event loop is explicit, JS's is implicit).
What doesn't translate
- Python has metaclasses; TypeScript doesn't (TC39 decorators are the closest analog).
- TypeScript has structural typing as the default; Python is nominal-leaning with Protocol opt-in.
- Python has GIL-bound concurrency; JavaScript has single-threaded event loop.
- TypeScript has mapped types, conditional types, template literal types; Python's type system is more limited at the type-computation level.
The two languages cover the same problem space with mirrored vocabularies. Once you've walked both quests, you carry one mind across both halves of the codebase. cwkPippa is the proof.