Figma’s Journey to TypeScript

Custom language (Skew) vs TypeScript

  • Skew was a custom, stricter compile‑to‑JS language used for Figma’s engine/prototyping; it delivered ~1.5–2x speedups over TypeScript thanks to more rigid typing and optimizations.
  • Over time it became a liability: niche skills, weaker tooling/IDE support, and risk if core experts left.
  • Migration only became feasible once WebAssembly was fast enough on mobile, letting Figma move performance‑critical code to C++/WASM and keep the remaining “glue” in TypeScript.
  • Some engineers missed Skew features (e.g., operator overloading, integer types) but broadly agreed the move to TypeScript was right for long‑term maintainability.

Custom stacks vs “standard” ecosystems

  • Several comments frame this as a familiar pattern: early custom tech (languages, frameworks, infra) replaced by mainstream tech once scale, hiring, and ecosystem support dominate.
  • Examples raised: CoffeeScript, Flow, Hack vs PHP, and Borg vs Kubernetes.
  • One camp says lesson is “don’t build custom languages”; others reply that “pet projects” often drive innovation, and open‑sourcing doesn’t guarantee community uptake.

TypeScript: value vs pain

  • Pro‑TS voices emphasize: fewer null/undefined errors, safer refactors, clearer APIs, and easier onboarding/maintenance in large, multi‑year, multi‑person codebases.
  • Critics argue TS is oversold for small teams/projects: added ceremony, fighting the type system, complex interactions with browser APIs, and little direct performance gain.
  • Tooling is a major pain point: Webpack/Vite/Rollup configs, SSR with React, monorepos, module formats, tsconfig complexity, and slow type‑checking (especially with heavy libraries like Zod or certain UI kits).
  • Some avoid TS entirely due to compile latency and the complexity/fragility of the JS build ecosystem; others mitigate with esbuild, tsx, Vite, or frameworks.

CoffeeScript, PHP, and ecosystem evolution

  • CoffeeScript is praised for ideas (everything as expressions, comprehensions, existential operator) but criticized for dangerous implicit variable declarations; many such ideas later landed in JS/TS.
  • Debate over PHP’s health: some say the community is “dying”; others cite active development, modern versions, and continued heavy usage, while questioning popular usage metrics.
  • Strict typing in PHP is described as significantly improving code quality, paralleling arguments for TypeScript.

WebAssembly and Figma performance

  • Commenters highlight Figma’s unusually snappy vector/graphics UX, attributing it to moving hot paths to C++/WASM and using TS mainly for UI and glue logic.
  • Some note Figma can still struggle with extremely complex documents, but overall performance is seen as a competitive advantage and key motivation for WASM adoption.

JavaScript semantics and performance quirks

  • Discussion of JS destructuring shows it goes through the iterator protocol, which can be much slower and allocation‑heavy; in some engines, object destructuring can outperform array destructuring.
  • The iterator spec is criticized as inherently inefficient; engines could theoretically special‑case arrays, but the language’s dynamism (e.g., patchable Symbol.iterator, proxies) complicates this.

TypeScript as “industry standard”

  • The article’s claim that TS is “the industry standard language for the web” divides opinion:
    • Some agree it reflects current reality in serious frontend work.
    • Others see it as sad that a transpiled superset, not JavaScript itself, is treated as the de facto standard.