// guess the programming language of the day

$ whois typescript

TypeScript

first released in 2012 · by Anders Hejlsberg

$ guessprog --inspect typescript

year
2012
paradigm
multi paradigm
family
c like
memory
automatic gc
binding
gradual
safety
weak

TYPESCRIPT(7)

AUTHORS
Anders Hejlsberg
HISTORY
TypeScript was released by Microsoft in October 2012, led by Anders Hejlsberg, the designer of Turbo Pascal, Delphi and C#. It was created to make large JavaScript codebases manageable by adding optional static types to JavaScript while compiling back to plain JavaScript that runs anywhere. Its structural, gradual type system is designed to describe the patterns real JavaScript code already uses. In 2025 the team announced a port of the compiler from TypeScript itself to Go to make it much faster.
USAGE
One of the most popular languages in the world and the default choice for many new JavaScript projects, both in the browser and on the server with Node.js, Deno and Bun. Most major frontend frameworks are written in or designed for TypeScript.
SEE ALSO
TypeScript on Wikipedia ↗
$ cat result.ts
type Result<T> =
  | { ok: true; value: T }
  | { ok: false; error: string };

function parseAge(input: string): Result<number> {
  const n = Number(input);
  return Number.isInteger(n) && n >= 0
    ? { ok: true, value: n }
    : { ok: false, error: `not an age: ${input}` };
}

const r = parseAge("42");
if (r.ok) console.log(r.value + 1); // narrowed to number
else console.error(r.error);