[rust-dev] Implementation of traits in Rust: could it be dynamic?

Lionel Parreaux lionel.parreaux at gmail.com
Sun Jul 27 09:36:06 PDT 2014

I see. Thanks for the links, Greg Morrisett's notes are a great survey of
possible approaches to this problem.
It is funny because I had also come to the conclusion that JIT was the
neater solution, as long as JIT is available with the runtime... and you
don't have to implement it -- I guess it's even more complex than doing
runtime dictionary passing.
Has there been experiments using LLVM's JIT to implement polymorphism in
Rust? I'm not sure about the cost of JIT, though. Maybe it would not make
sense in Rust. Well, at least there should still be the static
monomorphization option.

2014-07-26 5:31 GMT+02:00 Patrick Walton <pcwalton at mozilla.com>:

> On 7/25/14 8:26 PM, Patrick Walton wrote:
>> Uniform value representations work well too (as
>> OCaml shows), but of course you'll pay a performance cost for that.
> Oh, note that Greg's notes are a little bit out of date when discussing
> the performance tradeoffs of uniform value representation. On 64 bit (and
> even on 32 bit) you can do NaN-boxed "fatvals" [1] (scroll down to
> "Mozilla's New JavaScript Value Representation") which avoid having to box
> every floating point value.
> Patrick
> [1] http://evilpie.github.io/sayrer-fatval-backup/cache.aspx.htm
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140727/702fccdd/attachment.html>

More information about the Rust-dev mailing list