logoalt Hacker News

YuechenLi • yesterday at 8:07 PM • 1 reply • view on HN

The decision to use Go for TS7 compiler is even more baffling considering Go's low level memory management functionalities is nowhere near the level of C#'s Span<T> etc, especially since TS and C# are invented by the same person.

I got so worked up by it I built my own TyepScript compiler with my clankers in C# to prove that it can be done, my revival of the Common Language Runtime concept, project Copeland:

https://github.com/yuechen-li-dev/copeland

Currently, Copeland compiles a dialect of TypeScript to JavaScript, C#, WASM via Blazor WebAssembly, and NativeAOT, runs in csproj, and uses xUnit.NET for testing framework.

(The other reason is that Microsoft still refuses to do the obvious thing in .NET 11 and take the best part of Rust and let enums be `match`ed, despite the fact that both TypeScript and C# have weak enums historically, so I added payload enums to my TypeScript dialect because Microsoft won't.)


Replies

metek • today at 9:55 AM

https://learn.microsoft.com/en-us/dotnet/csharp/language-ref...

Pattern matching is in C# unless I misunderstood you.