News for hackers. Stuff that matters.
Re:“Land initial Rust MP4 parser and unit tests” by haberman on Thursday June 18, 2015 @03:57PM (#9741234)
Yes, I think of Rust as a promising target for parser generators. Thinking about text parsing, if Bison generated Rust, then you'd have a memory-safe parser that should be about as efficient as C. Something like this probably already exists or is being worked on. Ideally existing code generators could target Rust also to get memory safety.

There are some SIMD optimizations in parsers though that I don't know how easily you could express in Rust. The quintessential example of this for text parsing is Clang's optimization that uses SSE to skip over C++ comments 16 bytes at a time:

https://github.com/llvm-mirror/clang/blob/61f6bf2c8a8e94c4fa...

Re:“Land initial Rust MP4 parser and unit tests” by steveklabnik on Thursday June 18, 2015 @04:22PM (#9741390)
I am far from an expert in this area, but you can do SIMD with Rust: https://github.com/huonw/simd
Re:“Land initial Rust MP4 parser and unit tests” by haberman on Thursday June 18, 2015 @04:47PM (#9741523)
This looks like a good start (though experimental). If it supported something like AltaVec's vec_any_eq() intrinsic on its u8x16 type, that would do the trick. vec_any_eq() takes a vector and a value and returns true if any element of the vector equals the value.

On x86 with SSE, this could generate a sequence of two instructions: pcmpeqb (do 16 byte-wise compares) followed by pmovmskb (collect the 16 comparison results into a single byte). Then you'd get the same efficiency as what Clang does (Clang searches 8 bytes at a time for a '/' character when skipping over comments).

Re:“Land initial Rust MP4 parser and unit tests” by jroesch on Thursday June 18, 2015 @07:50PM (#9742285)
Huon is working on SIMD full time at Mozilla this summer as far as I know. We should see more mature support materialize in the next couple of months for sure.
Re:“Land initial Rust MP4 parser and unit tests” by buster on Friday June 19, 2015 @05:45AM (#9743788)
I have been working with https://github.com/kevinmehall/rust-peg for a while. Also there is https://github.com/Geal/nom