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

2014-01-29 Thread SiegeLord
On 01/29/2014 11:44 AM, Niko Matsakis wrote: 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

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

2014-01-28 Thread Kevin Ballard
It sounds like you're proposing that arbitrary functions may be eligible for CTFE if they happen to meet all the requirements, without any special annotations. This seems like a bad idea to me. I understand why it's attractive, but it means that seemingly harmless changes to a function's

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

2014-01-28 Thread Josh Matthews
Out of that list of requirements, #5 (doesn't perform I/O actions) is the one that strikes me as least well-defined. Could you elaborate on how you would enforce it? Cheers, Josh On 28 January 2014 14:15, Pierre Talbot ptal...@hyc.io wrote: Hi, The Mozilla foundation proposes research

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

2014-01-28 Thread Pierre Talbot
On 01/28/2014 11:24 PM, Kevin Ballard wrote: It sounds like you're proposing that arbitrary functions may be eligible for CTFE if they happen to meet all the requirements, without any special annotations. This seems like a bad idea to me. I understand why it's attractive, but it means that

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

2014-01-28 Thread Eric Reed
That's what I figured. Forbidding unsafe is definitely a good way to keep things simple starting out. Compile time evaluation can always be extended later on. On Tue, Jan 28, 2014 at 3:21 PM, Pierre Talbot ptal...@hyc.io wrote: On 01/28/2014 11:26 PM, Eric Reed wrote: Looks pretty reasonable

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

2014-01-28 Thread Pierre Talbot
The way it is implemented in Rust is by using the libc, but the requirement #6 says we can't call external function, so implicitly the problem is solved. I'm agree that it isn't formal, but I can't come up with a better solution for now. You made me think of another requirements (so basic

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

2014-01-28 Thread Huon Wilson
On 29/01/14 10:45, Kevin Ballard wrote: On Jan 28, 2014, at 3:16 PM, Pierre Talbot ptal...@hyc.io wrote: On 01/28/2014 11:24 PM, Kevin Ballard wrote: It sounds like you're proposing that arbitrary functions may be eligible for CTFE if they happen to meet all the requirements, without any