[rust-dev] Compile-time function evaluation in Rust

Niko Matsakis niko at alum.mit.edu
Wed Jan 29 08:44:18 PST 2014

On Tue, Jan 28, 2014 at 07:01:44PM -0500, comex wrote:
> Actually, Rust already has procedural macros as of recently.  I was
> wondering whether that could be combined with the proposed new system.

I haven't looked in detail at the procedural macro support that was
recently added, but off hand I think I favor that approach. That is,
I'd rather compile a Rust module, link it dynamically, and run it as
normal, versus defining some subset of Rust that the compiler can
execute. The latter seems like it'll be difficult to define,
implement, and understand. Our experience with effect systems and
purity has not been particularly good, and I think staged compilation
is easier to explain and free from the twin hazards of "this library
function is pure but not marked pure" (when using explicit
declaration) or "this library function is accidentally pure" (when
using inference).


More information about the Rust-dev mailing list