Live data from Hacker News

A 10x Faster TypeScript

devblogs.microsoft.com

461–470 of 943 posts

Re: A 10x Faster TypeScript

#461
post #177

Earlier quoted context omitted.

I wouldn't be asking if there wasn't a visceral reaction from Rust devs. I must have missed previous discussions on other threads.

Is this visceral reaction in the room with us now? Edit: I have reached the bottom of the thread and still have not seen this visceral reaction mentioned by the OP.

https://github.com/microsoft/typescript-go/discussions/411

There's more reactions here. I think devs have lost the plot, tbh.

Re: A 10x Faster TypeScript

#462
post #209

Earlier quoted context omitted.

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.

Honest q, which part is out of date and why? Thanks

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

#463
post #5

Fast dev tools are awesome and I am glad the TS team is thinking deeply about dev experience, as always! One trade off is if the code for TS is no longer written in TS, that means the core team won’t be dogfooding TS day in and day out anymore, which might hurt devx in the long run. This is one of the failure modes that hurt Flow (written in OCaml), IMO. Curious how the team is thinking about this.

The issue with Flow is that it's slow, flaky and has shifted the entire paradigm multiple times making version upgrades nearly impossible without also updating your dependencies, IF your dependencies adopted the new flow version as well. Otherwise you're SOL. As a result the amount of libraries that ship flow types has absolutely dwindled over the years, and now typescript has completely taken over.

Our experience is the opposite, we have a pretty large flow typed code base, and can do a full check in <100ms. When we converted to TS (decided not to merged) we saw typescript was in the multiple minute mark. It’s worth checking out LTI and how the typing on boundaries, enables flow to parallelize and give very precise error messages compared to TS. The third party lib support is however basically dead, except the latest versions of flow are starting to enable ingestion of TS types, so that’s interesting.

Re: A 10x Faster TypeScript

#464

Hi folks, Daniel Rosenwasser from the TypeScript team here. We're obviously very excited to announce this! RyanCavanaugh (our dev lead) and I are around to answer any quick questions you might have. You can also tune in to the Discord AMA mentioned in the blog this upcoming Thursday.

I am curious why dotnet was not considered - it should run everywhere Go does with added NativeAoT too, so I am especially curious given the folks involved ;)

(FWIW, It must have been a very well thought out rationale.)

Edit: watched the revenant clip from the GH discussion- makes sense. Maybe push NativeAoT to be as good?

I am (positively) surprised Hejlsberg has not used this opportunity to push C#: a rarity in the software world where people never let go of their darlings. :)

Re: A 10x Faster TypeScript

#465
post #218

Earlier quoted context omitted.

Not sure if it does but the video linked in the post might answer your question? I think he is compiling vscode which includes Monaco editor which is where they are getting 10x faster stat. (I might be wrong here.) [0] [0] https://youtu.be/pNlq-EVld70?feature=shared&t=112

Yeah I saw that but will they maintain a browser compatible version is another question

Ah, inception compiling. The issue isn't compiling the Monaco editor, but rather will the Monaco editor compile TypeScript 7 in the browser?

That is a good question.

Re: A 10x Faster TypeScript

#466

The post title is a bit misleading. It should say a 10x faster build time, or a 10x faster TypeScript compiler . tsc (compiler) is 10x faster, but not the final TS program runtime. Still an amazing feat! But doom will not run faster "To meet those goals, we’ve begun work on a native port of the TypeScript compiler and tools. The native implementation will drastically improve editor startup, reduce most build times by…

I don't think this is misleading for anyone familiar with Typescript. Typescript itself has no impact on performance, and it is known that the compilation and type-checking speed is often a problem. So I immediately assumed that it was about exactly that.

When I read the title I thought maybe they implemented a typescript to binary (instead of javascript) code compiler that speeds up the program by 10x, it would also have the added benefit of speeding up the compiler by 10x!

I don't think that is too far fetched either since typescript already has most of the type information.

Re: A 10x Faster TypeScript

#467
post #421

I'd like to see if it makes a difference to the version of DOOM that runs in the TypeScript type system. https://news.ycombinator.com/item?id=43184291 https://www.youtube.com/watch?v=0mCsluv5FXA

hi! author of the Doom thing, here. while I won't be the one to try, my answer is "absolutely yes, it will make a massive difference". Sub-1-day Doom-first-frame is probably a possibility now, if not much more because actually the thing that was the largest bottleneck for Doom-in-TypeScript-types was serializing the type to a string, which may well be considerably more than 10x faster. Hopefully someone will try some day!

Re: A 10x Faster TypeScript

#468
post #182

Earlier quoted context omitted.

Those are javascript runtimes, not TypeScript runtimes. The point stands. If you don't know enough about TypeScript to understand that TypeScript is not a runtime, I'm not sure why you would care about TypeScript being faster (in either case).

if typescript code execution got that much faster it might be a reason for someone to look into the language even if they knew nothing about it.

There are plenty of other reasons to consider TypeScript, but again, what code execution are referring to? The V8 JavaScript engine?

Re: A 10x Faster TypeScript

#469

Earlier quoted context omitted.

I love Rust, but you can play exactly the same game with Rust: https://github.com/Speykious/cve-rs

I mean, no? That's basically a known bug in Rust's compiler, specifically it's a soundness hole in type checking, and you'd basically never write it by accident - go read the guts of it for yourself if you think you might accidentally do this. At some point a next generation solver will make this not compile, and people will probably invent an even weirder edge case for that solver. Whereas the Go example is just how…

thank you for the clarification. you're right. I guess I was just trying to say that it's a spectrum (even if Rust is very very far along the way towards not having any holes). I can't seem to find it but there's some Tony Hoare or maybe Alan Turing quote or something like that about the only 100% correct computer program to ever exist was the first one.

Re: A 10x Faster TypeScript

#470

Earlier quoted context omitted.

It’s a political anti-benefit in most of the open-source world. And C# is not considered a high quality runtime once you leave Windows.

> And C# is not considered a high quality runtime once you leave Windows. By who?

Usually by someone who hasn't used C# since 2015 (when this opinion was fairly valid)
Post reply on HN