News for hackers. Stuff that matters.
Re:Graphics Team ships WebRender MVP by jerheinze on Tuesday May 21, 2019 @08:16AM (#19969407)
The article forgot to mention the important fact that it's written in Rust!
Re:Graphics Team ships WebRender MVP by Cynddl on Tuesday May 21, 2019 @08:28AM (#19969486)
Naive question: why is it important, compared to the developed features and new architecture?
Re:Graphics Team ships WebRender MVP by mkl on Tuesday May 21, 2019 @08:59AM (#19969687)
WebRender has come out of Mozilla's Servo browser engine project, which has had influence on the development of Rust itself. The language and the browser engine have been developed together, so this and other parts of the Quantum project [1] (mostly bringing parts of Servo into Firefox) are like the culmination of all this work, and a validation of the language.

[1] https://wiki.mozilla.org/Quantum

Re:Graphics Team ships WebRender MVP by oregontechninja on Tuesday May 21, 2019 @08:31AM (#19969506)
Because development of this particular project has been a large driving force of Mozilla's interaction with Rust.
Re:Graphics Team ships WebRender MVP by pygy_ on Tuesday May 21, 2019 @08:48AM (#19969617)

    <rust-evangelism-strike-force>
        FEARLESS CONCURRENCY
    </rust-evangelism-strike-force>
Rust makes it easier to write bug-free concurrent code. Webrender relies on this and I'm not sure Mozilla could have pulled it out in C++ in the same time frame, if at all.
Re:Graphics Team ships WebRender MVP by BubRoss on Tuesday May 21, 2019 @06:35PM (#19975826)
I think that's pretty presumptuous. My experience is that rust's checking is great, but much easier and safer concurrency can still be enabled by some work with data structures and program architecture.
Re:Graphics Team ships WebRender MVP by throwupaway123 on Tuesday May 21, 2019 @07:12PM (#19976096)
IMozilla engineers have specifically said Stylo (Quantum Style whatever) would be impossible in C++, because they actually tried it in C++. Presumably it'd be the same with WebRender.
Re:Graphics Team ships WebRender MVP by BubRoss on Wednesday May 22, 2019 @08:22AM (#19980352)
Impossible is a strong word. Architecture makes a very big difference. They can claim it is impossible, but it really doesn't make sense. I'm surprised anyone would just take their word for it.

Trying to use raw threads and ad-hoc futures is going to be difficult, but fundamentally concurrency is about separating data by dependencies.

Dependency graphs that pass data around combined with lock free data structures can be used to isolate parts of the program so that dealing with concurrency is one generic part of the program.

Re:Graphics Team ships WebRender MVP by jerheinze on Tuesday May 21, 2019 @08:33AM (#19969515)
Since Rust is a memory safe language with nearly the same performance as C
Re:Graphics Team ships WebRender MVP by frutiger on Tuesday May 21, 2019 @08:45AM (#19969595)
EDIT: Parent commenter edited the comment to append "with the same performance as C", so you can ignore my reply.

So is Python, JavaScript, Java, OCaml, Haskell...

A more distinguishing feature of Rust is not only that it is memory safe but also that it doesn’t have a GC.

In any case the presence of a single unsafe block can make the program no longer memory safe. Of course, if used appropriately, it vastly reduces the audit surface compared to something like C++.

Re:Graphics Team ships WebRender MVP by Someone1234 on Tuesday May 21, 2019 @09:12AM (#19969797)
None of those have nearly the same performance as C.
Re:Graphics Team ships WebRender MVP by frutiger on Tuesday May 21, 2019 @09:22AM (#19969876)
GP edited the comment, so now my reply looks silly.
Re:Graphics Team ships WebRender MVP by Cynddl on Tuesday May 21, 2019 @11:40AM (#19971175)
OCaml can have nearly the same performance as C.
Re:Graphics Team ships WebRender MVP by chronogram on Tuesday May 21, 2019 @09:23AM (#19969887)
Is GC a negative? I’ve yet to see anyone go “well I would’ve written this in Golang but it’s got GC”. Even that new Windows driver style, where it’s split in two, can have half of it being GC’d, right? Looking at https://en.wikipedia.org/wiki/Windows_Driver_Frameworks at least.
Re:Graphics Team ships WebRender MVP by saagarjha on Tuesday May 21, 2019 @09:59AM (#19970192)
> I’ve yet to see anyone go “well I would’ve written this in Golang but it’s got GC”.

This is a dealbreaker in a lot of contexts where garbage collection pauses would be unacceptable.

Re:Graphics Team ships WebRender MVP by ncmncm on Tuesday May 21, 2019 @10:03AM (#19970229)
Yes, GC is a negative. There is a huge literature in measures to mitigate its negatives. These always involve trading off one against another, and libraries are frequently incompatible with any particular mix of them.
Re:Graphics Team ships WebRender MVP by BubRoss on Tuesday May 21, 2019 @06:43PM (#19975880)
A GC is literally the only reason I haven't tried go.
Re:Graphics Team ships WebRender MVP by amelius on Tuesday May 21, 2019 @10:32AM (#19970476)
Can Rust target the GPU?
Re:Graphics Team ships WebRender MVP by steveklabnik on Tuesday May 21, 2019 @11:13AM (#19970864)
Sort of; it's not trivial, but some people have done it. See https://bheisler.github.io/post/rust-on-the-gpu-with-accel/ for example. I think https://blog.theincredibleholk.org/blog/2012/12/05/compiling... is the earliest one I know of; two and a half years before Rust 1.0!