Top all-time · #6529
Tan Li Hau
Personal blog · lihautan.comprogrammingweb
Tan Li Hau's personal blog at lihautan.com covers programming and web. Since 2019, 12 different Hacker News readers have linked it 20 times, most often “Compile Svelte in your head (pt 1)”. It is still writing: the last post was on 2025-07-20, and you can follow it by feed.
Too few sampled comments (5) to say how often HN recommends it.?
Why HN links it
HN readers link lihautan.com for write-ups on how JavaScript tools work internally, such as the Svelte compiler handbook and a two-part guide to compiling Svelte. Also a JSON parser implementation.
Summarised by Claude from a sample of 5 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Frontend Developer at Shopee Singapore.
Most-linked posts?
- Compile Svelte in your head (pt 1)2 people · 3 mentions · first linked 2020-03-04
- The Svelte Compiler Handbook2 people · 3 mentions · first linked 2020-04-05
- Extract parameter types from string literal types with TypeScript2 people · 2 mentions · first linked 2022-08-23
- Write a parser with JavaScript2 people · 2 mentions · first linked 2019-12-12
- Compile Svelte 5 in your head2 people · 2 mentions · first linked 2025-07-28
What Hacker News says?
Another good one https://lihautan.com/the-svelte-compiler-handbook/
Comment linking /the-svelte-compiler-handbook/
on “Show HN: 33 line React”Submitted The Svelte Compiler Handbook as a story · 330 points
HN discussionThis[0] (2-part blog entry) is a good write-up of what's going on, by a svelte contributor. Also, as suggested by the author, taking the tutorial[1] is useful (and the repl generally) to see what's going on. In the repl, look at the "JS output" tab. Play around with it to see what the compiler outputs. [0] https://lihautan.com/compile-svelte-in-your-head-part-1/ [1] https://svelte.dev/tutorial/basics
Comment linking /compile-svelte-in-your-head-part-1/
on “Show HN: 33 line React”Submitted Write a parser with JavaScript as a story · 114 points
HN discussionHere's a perfect example. I maintain a simple Node library designed to connect to Apple's App Store Connect API. https://github.com/dfabulich/node-app-store-connect-api It accepts, as a parameter, a URL for Apple's REST API. My library handles authentication, and returns the parsed JSON result, with a handful of tweaks to make the API more usable in JavaScript. Depending on which URL you request, you'll get differen…
Comment linking /extract-parameters-type-from-string-literal-types-with-typescript/
on “TypeScript is terrible for library developers”Submitted Compile Svelte 5 in your head as a story · 4 points
HN discussionFrom the same author, you may find this useful: https://lihautan.com/compile-svelte-in-your-head-part-1/
Comment linking /compile-svelte-in-your-head-part-1/
on “The Svelte Compiler Handbook”Submitted Compile Svelte in your head (pt 1) as a story · 4 points
HN discussionLearn infer and extends and you will accept all the downsides being zen from the height of your highly well typed codebase. If you don't find the following compelling: type IsParameter<Part> = Part extends `[$ {infer ParamName}]` ? ParamName : never; type FilteredParts<Path> = Path extends `$ {infer PartA}/$ {infer PartB}` ? IsParameter<PartA> | FilteredParts<PartB> : IsParameter<Path>; type ParamValue<Key> = Key ex…
Comment linking /extract-parameters-type-from-string-literal-types-with-typescript
on “Is TypeScript actually worth It?”Submitted Compile Svelte 5 in your head as a story · 3 points
HN discussionIt is also super powerful technique when using the closure of a function as a way to encapsulate logic and state. A good example is this implementation of a json parser in js[1]. Attempt at lifting the lexer functions or state out of the function would result in every function needing to be wrapped with a factory function. Parser have always been tricky and before I knew this technique I would have reached for a par…
Comment linking /json-parser-with-javascript/
on “Linear code is more readable”Submitted Babel AST Explorer as a story · 3 points
HN discussionSubmitted Extract parameter types from string literal types with TypeScript as a story · 2 points
HN discussionSubmitted Compile Svelte in your head (pt 2) as a story · 2 points
HN discussionSubmitted Manipulating AST with JavaScript as a story · 2 points
HN discussionSubmitted The Svelte Compiler Handbook as a story · 1 points
HN discussionSubmitted What is module bundler and how does it work? as a story · 1 points
HN discussionSubmitted Compile Svelte in your head (pt 4) as a story · 1 points
HN discussionSubmitted Compile Svelte in your head (pt 3) as a story · 1 points
HN discussionSubmitted I wrote my module bundler as a story · 1 points
HN discussion