Hacker News Viewer

The history of C# and TypeScript with Anders Hejlsberg | GitHub

by doppp on 1/27/2026, 5:07:35 PM

https://www.youtube.com/watch?v=uMqx8NNT4xY

Comments

by: socalgal2

I don&#x27;t know that many languages but, having been writing lots of typescript in the last 3 years there are so many things I love about it.<p>It infers types. If I do<p><pre><code> const data = [ { name: &#x27;bob&#x27;, age: 35, state: &#x27;CA&#x27; }, { name: &#x27;jill&#x27;, age: 37, state: &#x27;MA&#x27; }, { name: &#x27;sam&#x27;, age: 23, state: &#x27;NY&#x27; }, ]; </code></pre> Typescript knows data is an array of { name: string, age: number, state: string }. I don&#x27;t have to tell it.<p>Further, if I use any field, example<p><pre><code> const avg = data.reduce((acc, { age }) =&gt; acc + age, 0) &#x2F; data.length; </code></pre> It knows that `age` is a number. If I go change data and add an age that is not a number it will complain immediately. I didn&#x27;t have to first define a type for data, it inferred it in a helpful way.<p>Further, if I add `as const` at the end of data, then it will know &#x27;state&#x27; can only be one of `CA`, `MA`, `NY` and complain if I try to check it against any other value. Maybe in this case &#x27;state&#x27; was a bad choice of example but there are plenty of cases where this has been super useful both for type safety and for code completion.<p>There&#x27;s insane levels of depth you can build with this.<p>Another simple example<p><pre><code> const kColors = { red: &#x27;#FF0000&#x27;, green: &#x27;#00FF00&#x27;, blue: &#x27;#0000FF&#x27;, } as const; function keysOf&lt;T extends string&gt;(obj: { [k in T]?: unknown }): readonly T[] { return Object.keys(obj) as unknown[] as T[]; } type Color = keyof typeof kColors; const kAllColors = keysOf(kColors); </code></pre> Above, Color is effectively an enum of only &#x27;red&#x27;, &#x27;green&#x27;, &#x27;blue&#x27;. I can use it in any function and it will complain if I don&#x27;t pass something provably &#x27;red&#x27;, &#x27;green&#x27;, or &#x27;blue&#x27;. kAllColors is something I can iterate over all colors. And I can safely index `kColors` only by a Color<p>In most other languages I&#x27;ve used I&#x27;d have to first declare a separate enum for the type, then associate each of the &quot;keys&quot; with a value. Then separately make an array of enum values by hand for iteration, easy to get out of sync with the enum declaration.

2/1/2026, 8:51:49 AM


by: andrewstuart

We need Anders to make one final language.<p>A <i>MINIMAL</i> memory safe language. The less it has the better.<p>Rust without the crazy town complexity.<p>The distilled wisdom from C# and Delphi and TypeScript.<p>A programming language that has less instead of more.

2/1/2026, 8:16:25 AM