Live data from Hacker News

The history of C# and TypeScript with Anders Hejlsberg [video]

youtube.com

1–10 of 162 posts

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#2
We need Anders to make one final language.

A MINIMAL memory safe language. The less it has the better.

Rust without the crazy town complexity.

The distilled wisdom from C# and Delphi and TypeScript.

A programming language that has less instead of more.

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#3

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

Sounds like golang to me

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#4
post #3

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

Sounds like golang to me

Without the features I identified,yes, you’re right!

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#5

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

Oberon 07?

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#6

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

What would you take out of C# etc?

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#7
I don'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.

It infers types. If I do

    const data = [
      { name: 'bob', age: 35, state: 'CA' },
      { name: 'jill', age: 37, state: 'MA' },
      { name: 'sam', age: 23, state: 'NY' },
    ];
Typescript knows data is an array of { name: string, age: number, state: string }. I don't have to tell it.

Further, if I use any field, example

    const avg = data.reduce((acc, { age }) => acc + age, 0) / data.length;
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't have to first define a type for data, it inferred it in a helpful way.

Further, if I add `as const` at the end of data, then it will know 'state' can only be one of `CA`, `MA`, `NY` and complain if I try to check it against any other value. Maybe in this case 'state' 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.

There's insane levels of depth you can build with this.

Another simple example

    const kColors = {
      red: '#FF0000',
      green: '#00FF00',
      blue: '#0000FF',
    } as const;

    function keysOf(obj: { [k in T]?: unknown }): readonly T[] {
      return Object.keys(obj) as unknown[] as T[];
    }

    type Color = keyof typeof kColors;
    const kAllColors = keysOf(kColors);
Above, Color is effectively an enum of only 'red', 'green', 'blue'. I can use it in any function and it will complain if I don't pass something provably 'red', 'green', or 'blue'. kAllColors is something I can iterate over all colors. And I can safely index `kColors` only by a Color

In most other languages I've used I'd have to first declare a separate enum for the type, then associate each of the "keys" 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.

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#8

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

> Rust without the crazy town complexity.

To be clear, the language has a GC then?

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#9

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

What about Lua? The language is very minimal, memory safe, and has Pascal-like syntax just like Delphi.

Re: The history of C# and TypeScript with Anders Hejlsberg [video]

#10

I don'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. It infers types. If I do const data = [ { name: 'bob', age: 35, state: 'CA' }, { name: 'jill', age: 37, state: 'MA' }, { name: 'sam', age: 23, state: 'NY' }, ]; Typescript knows data is an array of { name: string, age: number, state: string }. I don't have to tell it. Further, if…

Lots of languages can infer types. And your last example with the colors is just a dictionary.
Post reply on HN