digitalmars.D - Add CTFE execute function
- Chang Long (8/8) May 26 2012 CTFE execute will be very useful on web develop, for example It
- Chang Long (5/13) May 27 2012 Let me make myself more clear, what I suggestion is something
- Don Clugston (2/16) May 29 2012
- Gor Gyolchanyan (7/29) May 29 2012 Yeah, but it requires re-implementing all those tools. If you already ha...
- Tobias Pankrath (2/7) May 29 2012 You just need a two step build process.
- Gor Gyolchanyan (6/13) May 29 2012 Two-step build process is complicated and tedious. The point here is to
- Tobias Pankrath (6/24) May 29 2012 If you rely on third party tools for code gen, it will be
- Gor Gyolchanyan (6/9) May 29 2012 ... which is precisely what we need to reduce all problems related to th...
- Tobias Pankrath (5/17) May 29 2012 If we do that, we should carefully design the system. If we
- Gor Gyolchanyan (6/26) May 29 2012 In any case being able to call external build systems is an important pa...
- Chang Long (7/31) Jul 19 2012 When translate the template code to D code, need a lot D type
- Nick Treleaven (11/22) Jul 20 2012 By coincidence, Walter recently mentioned something similar being
CTFE execute will be very useful on web develop, for example It is very hard to create a CTFE version template engine with rich feature. But we can use execute call to transe template file to d code string, then mixed it to application. The vibed project is very cool and I want to add my Jade template to this, but I can't find other way to do it. Maybe we also need a compiler option to enable this CTFE io operate because security.
May 26 2012
On Saturday, 26 May 2012 at 15:56:38 UTC, Chang Long wrote:CTFE execute will be very useful on web develop, for example It is very hard to create a CTFE version template engine with rich feature. But we can use execute call to transe template file to d code string, then mixed it to application. The vibed project is very cool and I want to add my Jade template to this, but I can't find other way to do it. Maybe we also need a compiler option to enable this CTFE io operate because security.Let me make myself more clear, what I suggestion is something like this: mixin( std.process.execute("/usr/bin/template_engine template_file_path.htm") );
May 27 2012
On 28/05/12 03:40, Chang Long wrote:On Saturday, 26 May 2012 at 15:56:38 UTC, Chang Long wrote:You can do a lot with import(filename);CTFE execute will be very useful on web develop, for example It is very hard to create a CTFE version template engine with rich feature. But we can use execute call to transe template file to d code string, then mixed it to application. The vibed project is very cool and I want to add my Jade template to this, but I can't find other way to do it.Maybe we also need a compiler option to enable this CTFE io operate because security.Let me make myself more clear, what I suggestion is something like this: mixin( std.process.execute("/usr/bin/template_engine template_file_path.htm") );
May 29 2012
Yeah, but it requires re-implementing all those tools. If you already have them implemented in D, then it's not a problem, but if you don't or they are closed-source, then import(filename) won't do much good. On Tue, May 29, 2012 at 1:46 PM, Don Clugston <dac nospam.com> wrote:On 28/05/12 03:40, Chang Long wrote:-- Bye, Gor Gyolchanyan.On Saturday, 26 May 2012 at 15:56:38 UTC, Chang Long wrote:You can do a lot with import(filename);CTFE execute will be very useful on web develop, for example It is very hard to create a CTFE version template engine with rich feature. But we can use execute call to transe template file to d code string, then mixed it to application. The vibed project is very cool and I want to add my Jade template to this, but I can't find other way to do it.Maybe we also need a compiler option to enable this CTFE io operate because security.Let me make myself more clear, what I suggestion is something like this: mixin( std.process.execute("/usr/bin/**template_engine template_file_path.htm") );
May 29 2012
On Tuesday, 29 May 2012 at 10:08:51 UTC, Gor Gyolchanyan wrote:Yeah, but it requires re-implementing all those tools. If you already have them implemented in D, then it's not a problem, but if you don't or they are closed-source, then import(filename) won't do much good.You just need a two step build process.
May 29 2012
On Tue, May 29, 2012 at 2:53 PM, Tobias Pankrath <tobias pankrath.net>wrote:On Tuesday, 29 May 2012 at 10:08:51 UTC, Gor Gyolchanyan wrote:Two-step build process is complicated and tedious. The point here is to avoid senseless complications. -- Bye, Gor Gyolchanyan.Yeah, but it requires re-implementing all those tools. If you already have them implemented in D, then it's not a problem, but if you don't or they are closed-source, then import(filename) won't do much good.You just need a two step build process.
May 29 2012
On Tuesday, 29 May 2012 at 11:51:34 UTC, Gor Gyolchanyan wrote:On Tue, May 29, 2012 at 2:53 PM, Tobias Pankrath <tobias pankrath.net>wrote:If you rely on third party tools for code gen, it will be complicated either way. Going this path means that you have to turn the compiler into a full build system. That finds the right tools in the path, gives good error messages if they are absent, that caches results etc.On Tuesday, 29 May 2012 at 10:08:51 UTC, Gor Gyolchanyan wrote:Two-step build process is complicated and tedious. The point here is to avoid senseless complications.Yeah, but it requires re-implementing all those tools. If you already have them implemented in D, then it's not a problem, but if you don't or they are closed-source, then import(filename) won't do much good.You just need a two step build process.
May 29 2012
On Tue, May 29, 2012 at 4:02 PM, Tobias Pankrath <tobias pankrath.net>wrote:Going this path means that you have to turn the compiler into a full build system. That finds the right tools in the path, gives good error messages if they are absent, that caches results etc.... which is precisely what we need to reduce all problems related to the build process to zero. This would solve a heap of problems. -- Bye, Gor Gyolchanyan.
May 29 2012
On Tuesday, 29 May 2012 at 16:32:17 UTC, Gor Gyolchanyan wrote:On Tue, May 29, 2012 at 4:02 PM, Tobias Pankrath <tobias pankrath.net>wrote:If we do that, we should carefully design the system. If we introduce the possiblity to execute arbitrary commands at compile time, we've just introduced the next generation preprocessor.Going this path means that you have to turn the compiler into a full build system. That finds the right tools in the path, gives good error messages if they are absent, that caches results etc.... which is precisely what we need to reduce all problems related to the build process to zero. This would solve a heap of problems.
May 29 2012
On Tue, May 29, 2012 at 9:47 PM, Tobias Pankrath <tobias pankrath.net>wrote:On Tuesday, 29 May 2012 at 16:32:17 UTC, Gor Gyolchanyan wrote:In any case being able to call external build systems is an important part of any build system. -- Bye, Gor Gyolchanyan.On Tue, May 29, 2012 at 4:02 PM, Tobias Pankrath <tobias pankrath.netIf we do that, we should carefully design the system. If we introduce the possiblity to execute arbitrary commands at compile time, we've just introduced the next generation preprocessor.wrote:Going this path means that you have to turn the compiler into a fullbuild system. That finds the right tools in the path, gives good error messages if they are absent, that caches results etc. ... which is precisely what we need to reduce all problems related tothe build process to zero. This would solve a heap of problems.
May 29 2012
On Tuesday, 29 May 2012 at 09:46:54 UTC, Don Clugston wrote:On 28/05/12 03:40, Chang Long wrote:When translate the template code to D code, need a lot D type arguments information. And one Web application may need very many page, and the type may change frequently. If I am not doing it on the CTFE will geometric increase workload. If D want to be participants in the web field, I think that this feature sooner or later will be needed.On Saturday, 26 May 2012 at 15:56:38 UTC, Chang Long wrote:You can do a lot with import(filename);CTFE execute will be very useful on web develop, for example It is very hard to create a CTFE version template engine with rich feature. But we can use execute call to transe template file to d code string, then mixed it to application. The vibed project is very cool and I want to add my Jade template to this, but I can't find other way to do it.Maybe we also need a compiler option to enable this CTFE io operate because security.Let me make myself more clear, what I suggestion is something like this: mixin( std.process.execute("/usr/bin/template_engine template_file_path.htm") );
Jul 19 2012
On 20/07/2012 03:08, Chang Long wrote:By coincidence, Walter recently mentioned something similar being integrated into D to support DStep: http://forum.dlang.org/post/jta97l$10hm$1 digitalmars.com So perhaps the above mixin would be: import "template_file_path.htm"; According to the link, that would execute: htm_to_D template_file_path.htm The htm_to_D program would generate a .d module which would then get imported. NickWhen translate the template code to D code, need a lot D type arguments information. And one Web application may need very many page, and the type may change frequently. If I am not doing it on the CTFE will geometric increase workload. If D want to be participants in the web field, I think that this feature sooner or later will be needed.Let me make myself more clear, what I suggestion is something like this: mixin( std.process.execute("/usr/bin/template_engine template_file_path.htm") );
Jul 20 2012