Skip to content
DevMeme
6030 of 7590
Languages Post #6602 · source on Telegram

TypeScript's Type System as a Japanese Grammar Linter

Description

A screenshot of a webpage for a library called 'Typed Japanese', which has a cherry blossom emoji next to its name. The main heading boldly claims, 'If you can write TypeScript, you can understand Japanese!'. Below this is a blue button that says 'Open in StackBlitz'. The central part of the image is a code editor displaying TypeScript code. This code defines types like `GodanVerb` and `ProperNoun` using Japanese characters and then constructs a complex interrogative phrase, which is type-checked by the compiler. The editor shows a tooltip with a type definition. The text at the bottom explains the project's purpose: 'Typed Japanese is a TypeScript type-level library that enables the expression of complete Japanese sentences through the type system. It creates a domain-specific language (DSL) based on Japanese grammar rules, allowing a subset of grammatically correct natural language to be written and verified using TypeScript's compiler.' This meme is a highly technical joke about the power and complexity of TypeScript's Turing-complete type system. It showcases an extreme example of type-level programming, where the compiler is manipulated to enforce rules far beyond simple data types, in this case, the grammar of a natural language. It's humorous to senior developers who understand just how absurdly powerful and abusable a sophisticated type system can be

Comments

15
Anonymous ★ Top Pick Finally, a way to ensure my comments are not only grammatically correct but also type-safe. The PR reviews are going to be brutal: 'LGTM, but this haiku has a type error in the third line.'
  1. Anonymous ★ Top Pick

    Finally, a way to ensure my comments are not only grammatically correct but also type-safe. The PR reviews are going to be brutal: 'LGTM, but this haiku has a type error in the third line.'

  2. Anonymous

    Great - now my linter corrects my kanji stroke order and still complains the variable is declared but never used

  3. Anonymous

    Finally, a type system so advanced it can catch your grammatical errors before your Japanese teacher does - though explaining to your PM why you're importing a linguistics library into the codebase might require its own type definition for 'creative technical debt justification'

  4. Anonymous

    Finally, a type system strict enough to catch grammatical errors in your comments before they make it to code review. Now your compiler can judge both your TypeScript *and* your Japanese particle usage - because apparently, catching runtime errors wasn't humbling enough

  5. Anonymous

    TypeScript types so dense they parse Japanese grammar flawlessly - yet still choke on your team's Pull Request comments

  6. Anonymous

    TypeScript generics expressive enough to model Japanese morphology - our compiler now speaks keigo; pity the PRD is still typed as any

  7. Anonymous

    At last, a codebase where tsc rejects your grammar - now waiting for the PR that adds discriminated unions for honorifics and a strict keigo mode that instantly breaks half of product’s specs

  8. @Titanlove2 1y

    I can

  9. @GlassySundew 1y

    They just invented 1c

  10. アレックス 1y

    This is just making fun of autistic people

    1. @andrei_nik_kolesnikov 1y

      Speak for yourself, I'm enjoying it :)

      1. アレックス 1y

        I know I’m making a joke about Japanese speakers and programmers

  11. @dsmagikswsa 1y

    I need a typed English to understand what this mean lol

  12. @Johnny_bit 1y

    Nani?

  13. Good Bye, Mother-Not-Found 1y

    wait why do you want to play haruhikage (anime meme)

Use J and K for navigation