News for hackers. Stuff that matters.
Re:A 10x Faster TypeScript by jjice on Tuesday March 11, 2025 @10:55AM (#43333075)
If I recall in an article from a while back, the idea was originally rust, but the current compiler design had lots of references shared references that would make the port to rust a lot of work.
Re:A 10x Faster TypeScript by pjmlp on Tuesday March 11, 2025 @11:00AM (#43333139)
Personally, Rust only makes sense in scenarios that automatic memory management of any kind is either unwanted, or it is a quixotic battle making the target group think otherwise.

OS kernels, firmware, GPGPU,....

If it is the ML inspired type system, there are plenty of options among compiled managed languages, true Go isn't really on that camp, but whatever.

Re:A 10x Faster TypeScript by surajrmal on Tuesday March 11, 2025 @12:09PM (#43333917)
Or possibly you want to use a language you're familiar with in adjacent spaces (eg tools) or you want to tackle concurrency bugs more directly. There is more to rust than it's
Re:A 10x Faster TypeScript by cheepin on Tuesday March 11, 2025 @11:58AM (#43333761)
Rust memory management is automatic. Object destructors run when the object exits scope without needing explicit management by the programmer
Re:A 10x Faster TypeScript by pjmlp on Tuesday March 11, 2025 @12:34PM (#43334202)
More like compiler assisted management, with compiler errors when the developer doesn't follow the teacher.
Re:A 10x Faster TypeScript by whattidywhat on Wednesday March 12, 2025 @07:05AM (#43341948)
The compiler ensures you are writing memory safe code. Otherwise it rejects that code and helps you see the mistake you made. Why people are so upset when the compiler prevents them from building and shipping unusable code will always baffle me.
Re:A 10x Faster TypeScript by pjmlp on Wednesday March 12, 2025 @10:28AM (#43343636)
There is nothing automatic in that.
Re:A 10x Faster TypeScript by whattidywhat on Wednesday March 12, 2025 @01:05PM (#43345346)
Asking a compiler to understand a programmers intent for underspecified mutability is beyond the halting problem.
Re:A 10x Faster TypeScript by senorrib on Wednesday March 12, 2025 @06:25PM (#43348311)
Theres a huge gap between inefficient and unusable. There’s a lot of usable code out there that leaks memory. I’d argue compilers are hardly pressed by memory usage given the transient nature of their execution.
Re:A 10x Faster TypeScript by whattidywhat on Thursday March 13, 2025 @09:42AM (#43353266)
Saying rust is unusable is pretty extreme. Tons of serious applications and infrastructure have been using it in production for years generating lots of money and preventing CVEs.

Leaking memory is sometimes not a huge issue. Missile allocation is real. Undefined behaviour, seg faults, data races, etc from edge cases slow down development.

The promise of rust isn't that it's super fast to learn but once you have you never deal with a swath of issues ever again.

And that's speaking from a deficit. Rust is an excellent language to do language development. It has arguably the best tooling for it in the ecosystem in my opinion and a vibrant community for it. Some of the most recent languages have foundations in rust. That is likely to continue going forward.

Re:A 10x Faster TypeScript by jjice on Tuesday March 11, 2025 @11:13AM (#43333280)
I'd love a language that is a GC'd like go, but with the ML inspired type system, and still an imperative language. OCaml seems to be the closest thing to Rust in that regard, but it's not imperative.
Re:A 10x Faster TypeScript by pjmlp on Tuesday March 11, 2025 @11:21AM (#43333359)
OCaml has if/else, for loops, whiles, mutations, what are you missing?

There are also Swift, F# (Native AOT), Scala (Native, GraalVM, OpenJ9).

Re:A 10x Faster TypeScript by elcritch on Tuesday March 11, 2025 @06:40PM (#43337877)
Nim is pretty close to that for me. It’s more pascal-ish inherited but has a sophisticated type system including case types similar to ML sum types and compile time.
Re:A 10x Faster TypeScript by dontlaugh on Tuesday March 11, 2025 @08:54PM (#43338857)
That language is Swift.
Re:A 10x Faster TypeScript by dist1ll on Tuesday March 11, 2025 @02:20PM (#43335476)
Dealing with references you typically find in a compiler is not a problem for Rust. Arena allocation and indices are your friend.
Re:A 10x Faster TypeScript by PartiallyTyped on Wednesday March 12, 2025 @01:53AM (#43340306)
Flattened asts are also faster than tree/pointer asts.
Re:A 10x Faster TypeScript by johnmw on Tuesday March 11, 2025 @05:35PM (#43337266)
I wonder if this project can easily be integrated into Deno (built mainly in Rust)?
Re:A 10x Faster TypeScript by zamalek on Tuesday March 11, 2025 @07:13PM (#43338129)
He also mentioned doing a line-for-line port. Assuming you could somehow manage that, you'd probably end up with something slower than JS (not entirely a joke). I'm a rust fanboy, but have to concede that Go was the be t choice here.

If it was a fresh compiler then the choice would be more difficult.