digitalmars.D - templates and files.
- kenny (17/17) Jan 07 2007 I was looking at h3retic's raytracer, and it got me thinking about using...
- Daniel Keep (10/32) Jan 07 2007 One wonders why you would not just write D code that generates D code as...
- Tom (6/13) Jan 07 2007 Hahaha, here am I, sitting at my PC, laughing out loud! (I feel such a
- Andrey Khropov (6/13) Jan 07 2007 Things are gonna be even more scary in the future. Because now W3C pushe...
- Georg Wrede (15/18) Jan 07 2007 Seeing T1 back in the 80's, I had almost a religious revelation. The
- Georg Wrede (2/6) Jan 07 2007 You've just described C#.
- Alexander Panek (3/11) Jan 07 2007 To quote Tom: Here I am, sitting in front of my PC, laughing out very
- Andrey Khropov (4/24) Jan 07 2007 Looks like what you need is Lisp (absolutely dynamic) or Nemerle (staged...
I was looking at h3retic's raytracer, and it got me thinking about using d's templates as a parser. Seriously thinking actually. The template language is strong enough, do you suppose we could use some of the phobos file functions inside of D templates to allow for file input and output? Uses I can think of off of the top of my head: 1. instead of having to store revision number in a d file, the template can look in .svn/entries or get the output of the linux command "date" 2. preparsed resources, including bitmaps, icons, and meshes (for games?) 3. preparsed interpreted languages (compiled DMDScript, lol?) 4. XML build script options 5. gui that is built off of an XML -- at compile time My primary use would be to generate D code based on an external script. For example, I could write generic code, then have a configuration file, which will be parsed for the directives at compile time instead of Kenny
Jan 07 2007
kenny wrote:I was looking at h3retic's raytracer, and it got me thinking about using d's templates as a parser. Seriously thinking actually. The template language is strong enough, do you suppose we could use some of the phobos file functions inside of D templates to allow for file input and output? Uses I can think of off of the top of my head: 1. instead of having to store revision number in a d file, the template can look in .svn/entries or get the output of the linux command "date" 2. preparsed resources, including bitmaps, icons, and meshes (for games?) 3. preparsed interpreted languages (compiled DMDScript, lol?) 4. XML build script options 5. gui that is built off of an XML -- at compile time My primary use would be to generate D code based on an external script. For example, I could write generic code, then have a configuration file, which will be parsed for the directives at compile time instead of KennyOne wonders why you would not just write D code that generates D code as output... which is *vaguely* what templates are, anyway. -- Daniel P.S. Interesting factoid: Haskell is in the odd position of having a type system so powerful, it's Turing-complete. Now THAT'S scary. P.P.S. Actually, scary would be a program that generates D code written in D, compiled to a turing machine tape, which is run by code written in the C preprocessor, which is run by a CPP written in the Haskell type system, compiled for another turing machine built using LEGO. *brainsplode*
Jan 07 2007
Daniel Keep escribió:kenny wrote:[...]P.P.S. Actually, scary would be a program that generates D code written in D, compiled to a turing machine tape, which is run by code written in the C preprocessor, which is run by a CPP written in the Haskell type system, compiled for another turing machine built using LEGO. *brainsplode*Hahaha, here am I, sitting at my PC, laughing out loud! (I feel such a nerd ;) ) Very funny :) -- Tom;
Jan 07 2007
Daniel Keep wrote:P.S. Interesting factoid: Haskell is in the odd position of having a type system so powerful, it's Turing-complete. Now THAT'S scary. P.P.S. Actually, scary would be a program that generates D code written in D, compiled to a turing machine tape, which is run by code written in the C preprocessor, which is run by a CPP written in the Haskell type system, compiled for another turing machine built using LEGO. brainsplodeThings are gonna be even more scary in the future. Because now W3C pushes forward that thing that they call Semantic Web, which will essentially turn Web into a worldwide weak AI system. How about a global brain? -- AKhropov
Jan 07 2007
Andrey Khropov wrote:Things are gonna be even more scary in the future. Because now W3C pushes forward that thing that they call Semantic Web, which will essentially turn Web into a worldwide weak AI system. How about a global brain?Seeing T1 back in the 80's, I had almost a religious revelation. The recursive storyline was already stunning, but the bit about Skynet reaching consciousness and then starting to learn at an exponential rate, just blew my socks off. And I saw it in 1984, Orwell's year. Our university got hooked up to the Internet in 1989, some five years later we got the WWW, things like CORBA, Yahoo, Google, Wikipedia, computer worms, malware, crackers, junk mail, DoS attacks, cell phones, blue-tooth viruses, ... I keep getting these /deja vu/s over and over again! If somebody told me Dan Brown's Digital Fortress has happened for real, I'd hardly raise an eyebrow. The times, they sure ain't gettin' boring. Heh, and there's no telling if the Internet actually will take down our civilization some day! And if somebody says they can't think of any way it could, I'd have to say that's the very point here, right?
Jan 07 2007
Daniel Keep wrote:P.P.S. Actually, scary would be a program that generates D code written in D, compiled to a turing machine tape, which is run by code written in the C preprocessor, which is run by a CPP written in the Haskell type system, compiled for another turing machine built using LEGO. *brainsplode*
Jan 07 2007
Georg Wrede wrote:Daniel Keep wrote:To quote Tom: Here I am, sitting in front of my PC, laughing out very loudly. Really. *whipes away the tear of laugh*P.P.S. Actually, scary would be a program that generates D code written in D, compiled to a turing machine tape, which is run by code written in the C preprocessor, which is run by a CPP written in the Haskell type system, compiled for another turing machine built using LEGO. *brainsplode*
Jan 07 2007
kenny wrote:I was looking at h3retic's raytracer, and it got me thinking about using d's templates as a parser. Seriously thinking actually. The template language is strong enough, do you suppose we could use some of the phobos file functions inside of D templates to allow for file input and output? Uses I can think of off of the top of my head: 1. instead of having to store revision number in a d file, the template can look in .svn/entries or get the output of the linux command "date" 2. preparsed resources, including bitmaps, icons, and meshes (for games?) 3. preparsed interpreted languages (compiled DMDScript, lol?) 4. XML build script options 5. gui that is built off of an XML -- at compile time My primary use would be to generate D code based on an external script. For example, I could write generic code, then have a configuration file, which will be parsed for the directives at compile time instead of execution time. KennyLooks like what you need is Lisp (absolutely dynamic) or Nemerle (staged). -- AKhropov
Jan 07 2007