News for hackers. Stuff that matters.
Re:TypeScript Is Surprisingly OK for Compilers by pjmlp on Friday August 18, 2023 @04:53AM (#37172955)
C# and Swift have pattern matching.
Re:TypeScript Is Surprisingly OK for Compilers by troupo on Friday August 18, 2023 @04:57AM (#37172980)
It's more limited than what you'd ideally want: pattern matching in function definitions. This makes walking ASTs a breeze.

Edit: And inline pattern matching for values returned from expressions and function calls (similar to destructuring, but more powerful).

Re:TypeScript Is Surprisingly OK for Compilers by pjmlp on Friday August 18, 2023 @12:34PM (#37178121)
I would say what C#12 does is already quite good, likewise for Swift.

Perfection is the enemy from good.

Those I can use at work, ML derived languages not, even F# is an uphill battle in most shops.