back

by teleforce·6y ago·view on hn ↗
For those you want the context of D please check its development history [1].

If history telling us something, python only take off after 20 years and now D language is around the 20 years mark. But fortunately D has passed the growing pain similar to python 2 to 3 when it transitioned to D2.

Personally I think D just need a big breakthrough in a form of a killer application like Ruby with RoR, and Go with Kubernetes to make it more popular and gets the snow ball rolling. The killer application probably involve some kind of data science or data analytics that is currently more popular now with python. But python seems starting to reach its limits and it will be good if D can take over.

For rust since it came from Mozilla team I'd expect by now Firefox is already re-written in rust by now but it seems yet to happen, and this article probably tell us why [2]. It will be wonderful to have Firefox-rust (if it ever happened) to replace Chrome that keeps eating away my quad core CPU and 16 GB ram laptop memory once opening more than 20 tabs.

[1]http://erdani.com/hopl2020-draft.pdf

[2]https://hacks.mozilla.org/2019/02/rewriting-a-browser-compon...

2 comments
> For rust since it came from Mozilla team I'd expect by now Firefox is already re-written in rust by now but it seems yet to happen, and this article probably tell us why [2]

Nope. In fact that article says:

> By 2017, Mozilla had made two previous attempts to parallelize the style system using C++. Both had failed.

And goes on to say how they were successfully able to re-write it in Rust, and then talks about the kind of security problems Rust solves and the ones beyond language scope (correctness).

But I don't think we really needed an article to tell us why a 20+ year old browser that has a billion man-hours of development hasn't been re-written in a language that has only been stable for five years, and has a relatively small team working on it.

Chrome may be using a lot of active memory, but I don’t think it’s a result of poor programming practices. So I don’t see how switching to Rust would solve the problem. Unless Chrome has a memory leak problem.

If anything, Chrome can just offload the contents of the unused tabs to the hard drive, and reload it when it becomes active again. But this will require a massive architectural change to the core program itself.

Web pages have memory leaks, not Chrome itself.

Side note, but at least on linux, with both Chromium and Firefox, you can observe exactly this behavior- tab-based segregated memory management. The work was done on both engines over the past several years, works beautifully now.

The content of each tab lives in a separate process. Kill the process, see the tab marked failed in the UI. Reload the tab, see a corresponding process spin back up.

I keep dozens of tabs open and periodically kill the ones that creep to the top of ram use, both wired ram and virtual. Keeps me from going into swap.