News for hackers. Stuff that matters.
Re:Rust once, run everywhere by lclarkmichalek on Friday April 24, 2015 @02:59PM (#9435364)
Here's an example of that in a lib I've been working on: https://github.com/bluepeppers/libnetfilter_queue/blob/maste...
Re:Rust once, run everywhere by cpeterso on Friday April 24, 2015 @04:11PM (#9435748)
Thanks for the example. What is the advantage of using an unmangled extern fn as a C callback? That the user-friendlier unmangled function name will appear in stack traces or can more safely be called from other Rust code?
Re:Rust once, run everywhere by lclarkmichalek on Friday April 24, 2015 @04:34PM (#9435863)
True, though it wouldn't be hard to write a GDB extension to unmangle the names (I know D had this from quite early in it's lifetime). In general, I leave unmangled names to things that are part of the external interface: when unmangling the name, I'm explicitly saying "this symbol's name is part of the contract I have with user of this library".
Re:Rust once, run everywhere by steveklabnik on Friday April 24, 2015 @04:59PM (#9435972)
There's already something that ships with Rust that unmangles some stuff: http://michaelwoerister.github.io/2015/03/27/rust-xxdb.html