TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How the TypeScript Compiler Compiles

89 pointsby knlamabout 3 years ago

4 comments

evmarabout 3 years ago
This is a bit misleading in where the &quot;Type Checker&quot; box is pictured, but I think it&#x27;s due to an understandable confusion about how the compiler is structured.<p>Importantly, <i>types do not affect TypeScript emit</i>[1]: you can take a TS program, replace every type with Banana and the compiler will have the same output.<p>(I am not sure, but I think the TypeScript emitter does use a &quot;type checker&quot; object for type-adjacent things like resolving scopes. But it does not use such an object for checking types during emit. Another way of saying this is that type checking can be done during emit but conceptually it&#x27;s a an optional segue on the side, not the box immediately leading to .js files.)<p>[1]: <a href="http:&#x2F;&#x2F;neugierig.org&#x2F;software&#x2F;blog&#x2F;2016&#x2F;04&#x2F;typescript-types.html" rel="nofollow">http:&#x2F;&#x2F;neugierig.org&#x2F;software&#x2F;blog&#x2F;2016&#x2F;04&#x2F;typescript-types....</a>
评论 #31004444 未加载
primitivesuaveabout 3 years ago
Typo in the title (should be &quot;Compiler&quot; and not &quot;Complier&quot;)
评论 #31002507 未加载
评论 #31004632 未加载
评论 #31006245 未加载
gherkinnnabout 3 years ago
Excellent article. The entire blog has heaps of good stuff. What a find.<p>I wish more tech blogs were this well-written and focused.
评论 #31006375 未加载
LewisVerstappenabout 3 years ago
Love the illustrations. How did you make them?
评论 #31000697 未加载
评论 #31004334 未加载