Re: CTFE thoughts & functional approach

2016-02-08 Thread Robert M. Münch via Digitalmars-d
On 2016-01-31 13:59:06 +, Robert M. Münch said: I like CTFE and the meta programming idea for languages like D. However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty different and doing

Re: CTFE thoughts & functional approach

2016-02-02 Thread Robert M. Münch via Digitalmars-d
On 2016-01-31 14:35:13 +, cym13 said: I see things differently. First of all I don't see everyone trying to do meta-programming with the same language. C++ for example has a quite specific syntax between its arcane templates and the preprocessor. Well, ok, maybe a "using the same concepts

Re: CTFE thoughts & functional approach

2016-02-02 Thread deadalnix via Digitalmars-d
On Tuesday, 2 February 2016 at 08:34:38 UTC, Robert M. Münch wrote: On 2016-02-01 08:15:11 +, deadalnix said: I'm not sure what is preventing you from doing that already. There is compile time reflection (has access to some compiler internals) and D support functional style. Unless you

Re: CTFE thoughts & functional approach

2016-02-02 Thread Robert M. Münch via Digitalmars-d
On 2016-02-01 08:15:11 +, deadalnix said: I'm not sure what is preventing you from doing that already. There is compile time reflection (has access to some compiler internals) and D support functional style. Unless you have some specific in mind, I don't think there is anything we can do

Re: CTFE thoughts & functional approach

2016-02-02 Thread Robert M. Münch via Digitalmars-d
On 2016-01-31 15:31:59 +, anonymous said: You're conflating CTFE with the other meta programming tools here. CTFE is the same language as run-time D, but it doesn't have strange template syntax. Templates, static if, __traits, etc. have strange syntax, but they're sort of a different

Re: CTFE thoughts & functional approach

2016-02-02 Thread Robert M. Münch via Digitalmars-d
On 2016-02-02 08:39:34 +, deadalnix said: That is definitely true that the compile time API is kind of screwy. That's definitively not you. I think the best path forward at this stage is to provide nice API as a library on top of it. And if we do this, it's only a small step to add a

Re: CTFE thoughts & functional approach

2016-02-02 Thread Ola Fosheim Grøstad via Digitalmars-d
On Tuesday, 2 February 2016 at 08:31:07 UTC, Robert M. Münch wrote: No, my point is that CTFE and meta-programming seems to be much simpler and powerful if I can use a more functional programming approach for it. Working with powerful lists and data = code and code = data concept would

Re: CTFE thoughts & functional approach

2016-02-02 Thread anonymous via Digitalmars-d
On 02.02.2016 09:27, Robert M. Münch wrote: ==> BEGIN [...] enum A {afoo, bfoo, cfoo}; (Aside: In D no semicolon is needed here.) string generateEnums(T...)(string type){ string code = "enum " ~ type ~ " {"; // this is a static foreach (compile time) foreach(m; T){

Re: CTFE thoughts & functional approach

2016-02-01 Thread deadalnix via Digitalmars-d
On Sunday, 31 January 2016 at 13:59:06 UTC, Robert M. Münch wrote: I like CTFE and the meta programming idea for languages like D. However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty

Re: CTFE thoughts & functional approach

2016-01-31 Thread Era Scarecrow via Digitalmars-d
On Sunday, 31 January 2016 at 13:59:06 UTC, Robert M. Münch wrote: However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty different and doing CTFE, code-generation etc. needs some other

Re: CTFE thoughts & functional approach

2016-01-31 Thread cym13 via Digitalmars-d
On Monday, 1 February 2016 at 00:02:55 UTC, Era Scarecrow wrote: On Sunday, 31 January 2016 at 13:59:06 UTC, Robert M. Münch wrote: However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty

Re: CTFE thoughts & functional approach

2016-01-31 Thread anonymous via Digitalmars-d
On Sunday, 31 January 2016 at 13:59:06 UTC, Robert M. Münch wrote: I like CTFE and the meta programming idea for languages like D. However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty

CTFE thoughts & functional approach

2016-01-31 Thread Robert M. Münch via Digitalmars-d
I like CTFE and the meta programming idea for languages like D. However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty different and doing CTFE, code-generation etc. needs some other

Re: CTFE thoughts & functional approach

2016-01-31 Thread cym13 via Digitalmars-d
On Sunday, 31 January 2016 at 13:59:06 UTC, Robert M. Münch wrote: I like CTFE and the meta programming idea for languages like D. However, I'm wondering why most (everyone?) is trying to do meta-programming using the same language as the one getting compiled. IMO the use-cases a pretty