News for hackers. Stuff that matters.
Re:Writing a website in Rust by ilaksh on Saturday May 30, 2015 @02:08PM (#9631103)
Hmm.. Rust was created to support the new browser, browsers mainly manage DOM objects.. I wonder why you are using a legacy garbage collector in order to handle primary tasks rather than having that part of your core design?
Re:Writing a website in Rust by kibwen on Saturday May 30, 2015 @02:48PM (#9631286)
SpiderMonkey's GC is very modern, it's not legacy at all. Furthermore, while Servo influences the design of Rust, it does not dictate the design of Rust (or else, for example, Rust would have had struct inheritance years ago).
Re:Writing a website in Rust by viraptor on Saturday May 30, 2015 @02:20PM (#9631166)
Spidermonkey uses generational gc with some kind of compacting these days. Why do you think that's legacy? What models are strictly better than that?
Re:Writing a website in Rust by ilaksh on Saturday May 30, 2015 @02:35PM (#9631226)
Nim's garbage collector is better than Spidermonkey's.
Re:Writing a website in Rust by Manishearth on Saturday May 30, 2015 @02:44PM (#9631263)
Irrelevant here.

For Servo we need a javascript engine. We're already using Spidermonkey. It has a GC for Javascript; we're already paying those costs. The Rust-side representation of DOM objects is also managed by the GC; that makes sense because these are tied to Javascript things.

We don't use the GC elsewhere. I think at some point we did, but the only place now in Servo where GC is used is where the data is strongly connected to data already managed by the SM GC.

Nim's GC is for general-purpose use in a language. Spidermonkey's GC is for GCing javascript, which already has an extensive runtime (which the GC ties into heavily). "Nim's GC is better than Spidermonkey's" is a statement of no value (and oversimplifies the situation) unless the context is specified. Using the SM GC to collect random Rust objects would be a bad idea. Somehow rigging up spidermonkey to use a Nim-like GC in Rust (all other things being the same) would also be a bad idea. Two different scenarios, two different GCs.

Re:Writing a website in Rust by pcwalton on Saturday May 30, 2015 @04:44PM (#9631685)
No, it's not. Generational, incremental, precise GC generally outperforms non-generational, non-incremental, conservative deferred reference counting.
Re:Writing a website in Rust by Ygg2 on Saturday May 30, 2015 @02:23PM (#9631171)
Because rewriting Spidermonkey is both tedious and doesn't benefit from Rust safety guarantees.