News for hackers. Stuff that matters.
Re:A 10x Faster TypeScript by neonsunset on Tuesday March 11, 2025 @11:49AM (#43333673)
This is shockingly out-of-date statement by Anders. I'm not sure what's going on, I guess he's just not involved with the runtime side of .NET at all to actually know where the capability sits circa 2024/2025. But really, it's a terrible situation to be in. Especially just how worse langdev UX in Go is compared to C#, F# or Rust. No one would've batted an eye if either of those was used.
Re:A 10x Faster TypeScript by thund on Tuesday March 11, 2025 @12:16PM (#43333995)
Honest q, which part is out of date and why? Thanks
Re:A 10x Faster TypeScript by valcron1000 on Tuesday March 11, 2025 @03:03PM (#43335918)
Pretty much everything:

> While C# does have AOT capabilities nowadays this is not as mature as Go's and not all platforms support it

https://learn.microsoft.com/en-us/dotnet/core/deploying/nati...

Only Android is missing from that list (marked as "Experimental"). We could argue about maturity but this is a bit subjective.

> Go also has somewhat better control over data layout

How? C# supports structs, ref structs (stack allocated only structures), explicit stack allocation (`stackalloc`), explicit struct field layouts through annotations, control over method local variable initialization, control over inlining, etc. Hell, C# even supports a somewhat limited version of borrow checking through the `scoped` keyword.

> This is meant to be something of a 1:1 port rather than a rewrite, and the old code uses plain functions and data structures without an OOP style.

C# has been consistently moving into that direction by taking more and more inspiration from F#.

The only reasonable reason would be extensive usage of structural typing which is present in TS and Go but not in C#.

Re:A 10x Faster TypeScript by neonsunset on Tuesday March 11, 2025 @04:01PM (#43336443)
Chances are it was just personal preference of the team and decades of arguing about language design have worn out Anders Hejlsberg. I don't think structural typing alone is enough of an argument to justify the choice over Rust. Maybe the TS team thought choosing Go would have better optics. Well, they won't have it both ways because clearly this decision in my opinion is short-sighted and as someone aptly pointed on twitter they will be now beholden to Google's control over Go should they ever need compiler to support a new platform or evolve in a particular way. Something they would've gotten easily with .NET.
Re:A 10x Faster TypeScript by vips7L on Tuesday March 11, 2025 @05:33PM (#43337251)
On the topic of preference, this thread has really shown me that there is a HUGE preference for a native-aot gc language that is _not_ Go. People want AOT because of the startup and memory characteristics, but do not want to sacrifice language ergonomics. C# could fill that gap if Microsoft would push it there.
Re:A 10x Faster TypeScript by pebal on Tuesday March 11, 2025 @06:11PM (#43337631)
Just use the fast GC library in C++.
Re:A 10x Faster TypeScript by vips7L on Tuesday March 11, 2025 @07:08PM (#43338096)
I don't think C++ has good language ergonomics.
Re:A 10x Faster TypeScript by pebal on Tuesday March 11, 2025 @07:33PM (#43338289)
I don't think there is anything faster.
Re:A 10x Faster TypeScript by vips7L on Tuesday March 11, 2025 @08:52PM (#43338839)
I highly doubt that bolting a GC on to C++ is going to be any faster than the equivalent C# or Java code.
Re:A 10x Faster TypeScript by pebal on Tuesday March 11, 2025 @09:27PM (#43339048)
Doubt is human, but it isn’t always warranted. In C++ can use a concurrent, completely pause‐free garbage collector, where the programmer decides which data is managed by the GC. This enables code optimizations in ways that aren’t possible in C# and Java.
Re:A 10x Faster TypeScript by vips7L on Tuesday March 11, 2025 @10:59PM (#43339536)
You realize that is literally not the same thing? I said equivalent code. The whole reason of using a managed language with GC is to not think about those things because they eat up thought and development time. Of course the language that will let you hand optimize every little line will eventually be more performant. I really think you’re discounting both C#’s ability to do those things and just how good Java’s GCs are. Anyway, thats not the point.

The point is C++ sucks dude. There is no way that you can reasonably think that bolting a GC on to C++ is going to be a pleasurable experience. This whole conversation started with _language ergonomics_. I don’t care that it’ll save 0.5 milliseconds. I’d rather dig holes than write C++.

Re:A 10x Faster TypeScript by pebal on Wednesday March 12, 2025 @04:53AM (#43341085)
Where performance is paramount, developer convenience takes a backseat. Moreover, C++ has evolved significantly in recent years and is now quite enjoyable to use. We’re also discussing a tool in this thread whose performance is critical for developers. Over-simplifying code will ultimately lead to programmers using such solutions being replaced by AI, while the software itself will demand enormous computational power. That’s not the way forward.
Re:A 10x Faster TypeScript by vips7L on Wednesday March 12, 2025 @08:01AM (#43342310)
We’re talking about a tool whose performance profile with a managed language is perfectly acceptable as deemed by the choice to use Go. Let alone the fact that this thread you’ve been replying in has never been about achieving the utmost performance.

You’re absolutely delusional if you think C++ is enjoyable compared to any managed language or if you think AI is capable of replacing anything.

You’ve moved this conversation extremely far off topic and I won’t be replying again.

Cheers dude. Good luck with your chat bots and CVE’s from your raw pointers.

Re:A 10x Faster TypeScript by pebal on Wednesday March 12, 2025 @09:13AM (#43342887)
I assume that the original performance profile of these tools was satisfactory to their creators, yet they still decided to rewrite them. I admire programmers who claim that their tools don't need to be maximally optimized. This is likely an attempt to justify the fact that their products aren't exceptionally performant either. Just take a look at the TIOBE rankings, and you'll see how many programmers hold a different view than you.
Re:A 10x Faster TypeScript by pjmlp on Wednesday March 12, 2025 @10:31AM (#43343656)
It works for Unreal.
Re:A 10x Faster TypeScript by neonsunset on Tuesday March 11, 2025 @08:14PM (#43338583)
To correct myself, someone pointed out a commit graph which indicates Anders Hejlsberg's heavy involvement with the ongoing port efforts: https://github.com/microsoft/typescript-go/graphs/contributo...
Re:A 10x Faster TypeScript by foobarbaz33 on Thursday March 13, 2025 @02:17PM (#43355918)
> C# supports structs,

That's sort of the problem with C#. It couples the type (struct vs class) with allocation. C# started life by copying 1990's Java "everything-is-a-reference". So it's in a weird place where things were bolted on later to give more control but still needs to support the all-objects-are-refs style. C# is just not ergonomic if you need to care about data layout in memory.

Go uses a C-like model. Everything is a value type. Real pointers are in the language. Now you can write a function that inputs pointers and does not care whether they point to stack, heap, or static area. That function can be used for all 3 types, no fuss.

Re:A 10x Faster TypeScript by valcron1000 on Saturday March 15, 2025 @02:44AM (#43370530)
> It couples the type (struct vs class) with allocation

Agree. Where things are allocated is a consumer decision.

> C# is just not ergonomic if you need to care about data layout in memory

I disagree. I work on a public high performance C# code and I don't usually face issues when dealing with memory allocations and data layout. You can perfectly use structs everywhere (value types) and pass references when needed (`ref`).

> Now you can write a function that inputs pointers and does not care whether they point to stack, heap, or static area.

You can do this perfectly fine in C#, it might not be what some folks consider "idiomatic OOP" but I could not care less about them.

Re:A 10x Faster TypeScript by dimgl on Tuesday March 11, 2025 @11:53AM (#43333709)
> Especially just how worse langdev UX in Go is compared to C#, F# or Rust.

Can you explain why the DX in Go is "worse"? I've seen the exact opposite during my professional work.

Re:A 10x Faster TypeScript by madeofpalk on Tuesday March 11, 2025 @12:54PM (#43334498)
Lack of optionals/enum/sum types is a huge regression from Typescript to go IMHO.
Re:A 10x Faster TypeScript by whimsicalism on Tuesday March 11, 2025 @01:59PM (#43335278)
the typing situation in Go is a mess, GADTs are generally a joy to work with, nullability is not.
Re:A 10x Faster TypeScript by whatthemick on Tuesday March 11, 2025 @12:09PM (#43333918)
Isn't the AOT story for F# pretty meh? AOT + System.Text.Json requires source generation as best I can tell, which F# doesn't support yet (to my knowledge).
Re:A 10x Faster TypeScript by neonsunset on Tuesday March 11, 2025 @12:14PM (#43333965)
In a complex projects like this, Go requires manual scripting and build-time code generation. Arguably, writing a small shim project in C# is much easier. You don't exactly do a lot of JSON serialization in a compiler either way. Other than that - F# "just works" and does not require anything extra. It is just IL after all.

The most important part here is that TypeScript at Microsoft is a "first-party" customer. This means if they need additional compiler accommodations to improve their project experience from .NET, they could just raise it and they will be treated with priority. This decision is technically and politically unsound at multiple levels at once. For example, they will need good WASM support. .NET's existing WASM support is considered "decent" and even that one is far from stellar, yet considered way ahead the Go one. All they needed is to allocate additional funding for the ongoing already working NativeAOT-LLVM-WASM prototype to very quickly get the full support of the target they needed. But alas.

Re:A 10x Faster TypeScript by pjmlp on Tuesday March 11, 2025 @12:36PM (#43334240)
I already hinted on BlueSky that they shouldn't wonder why .NET has adoption problems outside the traditional Windows ecosystem, when decisions like these are taken.
Re:A 10x Faster TypeScript by neonsunset on Tuesday March 11, 2025 @12:39PM (#43334280)
The nightmare of Midori never ends. And especially right as the platform, from the technical standpoint, is getting really good(tm).