Thread overview | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
January 07, 2007 templates and files. | ||||
---|---|---|---|---|
| ||||
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. Mostly thinking about #5 though. Kenny |
January 07, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to kenny | 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. Mostly thinking about #5 though.
>
> Kenny
One 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*
|
January 07, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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; |
January 07, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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. brainsplode 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? -- AKhropov |
January 07, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to kenny | 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. Mostly thinking about #5 though. > > Kenny Looks like what you need is Lisp (absolutely dynamic) or Nemerle (staged). -- AKhropov |
January 07, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | 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*
You've just described C#.
|
January 08, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrey Khropov | 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?
|
January 08, 2007 Re: templates and files. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | Georg Wrede wrote:
> 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*
>
> You've just described C#.
To quote Tom: Here I am, sitting in front of my PC, laughing out very loudly. Really. *whipes away the tear of laugh*
|
Copyright © 1999-2021 by the D Language Foundation