Re: Compiler concept

2016-12-13 Thread bauss (wtf happend to my name took some old cached title LOL??) via Digitalmars-d
On Tuesday, 13 December 2016 at 12:58:42 UTC, Swoorup Joshi wrote: On Tuesday, 13 December 2016 at 01:03:54 UTC, Ignacious wrote: Would it be difficult to implement the following, or something with similar capabilities, as a patch to dmd? [...] Isn't this what string mixin is for Not reall

Re: Compiler concept

2016-12-13 Thread Swoorup Joshi via Digitalmars-d
On Tuesday, 13 December 2016 at 01:03:54 UTC, Ignacious wrote: Would it be difficult to implement the following, or something with similar capabilities, as a patch to dmd? [...] Isn't this what string mixin is for

Re: Compiler concept

2016-12-13 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 13 December 2016 at 07:44:54 UTC, Jacob Carlborg wrote: Doing something like AST macros (which this sounds like) is not _that_ difficult. I was thinking doing it at run time... doing it at compile time indeed isn't that bad (it still looks like the interpreter tree at that point).

Re: Compiler concept

2016-12-12 Thread Jacob Carlborg via Digitalmars-d
On 2016-12-13 04:38, rikki cattermole wrote: As CTFE has proven, its do-able but we would be talking at least 6-9 months worth of work. With no way its going into upstream. Not to mention we'd need a whole host of AST nodes in druntime. So really not worth the effort. Doing something like AST

Re: Compiler concept

2016-12-12 Thread rikki cattermole via Digitalmars-d
On 13/12/2016 2:57 PM, Adam D. Ruppe wrote: On Tuesday, 13 December 2016 at 01:03:54 UTC, Ignacious wrote: Would it be difficult to implement the following, or something with similar capabilities, as a patch to dmd? It would be pretty hard to do with dmd because compiled code isn't designed fo

Re: Compiler concept

2016-12-12 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 13 December 2016 at 01:03:54 UTC, Ignacious wrote: Would it be difficult to implement the following, or something with similar capabilities, as a patch to dmd? It would be pretty hard to do with dmd because compiled code isn't designed for modification, but it wouldn't be too hard

Compiler concept

2016-12-12 Thread Ignacious via Digitalmars-d
Would it be difficult to implement the following, or something with similar capabilities, as a patch to dmd? Create a compiler that lets one use actual code as templates. e.g., a text block of a function can be referenced by in the code using a "dom" to modify that code similar to how we can m