-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 8/24/10 17:51 , Richard O'Keefe wrote:
> On Aug 22, 2010, at 7:34 PM, Jesse Schalken wrote:
>> I would also like to strongly discourage code generators.
>
> I've used ad hoc code generators a lot, and never had
> reason to regret it.
>
> The key p
On 25 August 2010 07:51, Richard O'Keefe wrote:
>
> On Aug 22, 2010, at 7:34 PM, Jesse Schalken wrote:
>
>> Every software project which I've worked on that used a code generator
>> turned into a nightmare, because when we find we need to change
>> something about the generator's output, all the a
Quoth "Richard O'Keefe" ,
...
>> Of course code generation is perfectly fine when the output is not
>> intended to be read and maintained by a human.
>
> "Read" and "maintained" are two different issues.
> Depending on the tool-chain, it may be necessary for people to
> read the generated code whil
In the past I've taken a hybrid approach - ad-hoc fixes are done to the
generated code, but it is done via 'patch' as an automated step, and the
diff is stored in source control with everything else.
You'll need extra tool support to build the diff, as well.
It's still really brittle, and I would
On Aug 22, 2010, at 7:34 PM, Jesse Schalken wrote:
> I would also like to strongly discourage code generators.
I've used ad hoc code generators a lot, and never had
reason to regret it.
The key point is that ALL maintenance of the generated code
must be done by maintaining the generator and its
Jesse Schalken writes:
> I would also like to strongly discourage code generators.
>
> Any code that has to be "generated" can and should have its common
> characteristics separated out with only unique characterstic remaining
> typically with an interface (i.e. type class) or polymorphic type
>
Jesse Schalken wrote:
I would also like to strongly discourage code generators.
Any code that has to be "generated" can and should have its common
characteristics separated out with only unique characterstic remaining
typically with an interface (i.e. type class) or polymorphic type
dividing th
Bill Atkins wrote:
Have you looked at creating Template Haskell splices to generate this for you?
The thought had crossed my mind.
On the other hand, with my current approach, the generated code is just
another source file that doesn't look any different. On reflection, I
kinda like that.
I would also like to strongly discourage code generators.
Any code that has to be "generated" can and should have its common
characteristics separated out with only unique characterstic remaining
typically with an interface (i.e. type class) or polymorphic type
dividing the two, creating a separa
Have you looked at creating Template Haskell splices to generate this for you?
On Friday Aug 20, 2010, at 2:21 PM, Andrew Coppin wrote:
> All I'm actually using it to do is generate a set of fixed-size containers
> (each of which has a bazillion class instances). I've got a variable-sized
> con
Andrew Coppin wrote:
> Well, yeah, if you've got so much boiler plate that you have to automate
> generating the boilerplate, you're probably doing it wrong. ;-)
>
> All I'm actually using it to do is generate a set of fixed-size
> containers (each of which has a bazillion class instances). I'v
Graham Klyne wrote:
Maybe not helpful to you at this stage, but...
An alternative to generating source code is to factor out the common
"boilerplate" elements into separate functions, suitably
parameterized, and to use higher order functions to stitch these
together.
Well, yeah, if you've g
Check out the userHooks in Cabal[1]. I believe you can use, e.g.
hookedPreProcessors[2], or preBuild to preprocess your files into
regular Haskell files before building takes place.
[1]:
http://www.haskell.org/ghc/docs/6.12.1/html/libraries/Cabal/Distribution-Simple-UserHooks.html#t%3AUserHooks
[
Maybe not helpful to you at this stage, but...
An alternative to generating source code is to factor out the common
"boilerplate" elements into separate functions, suitably parameterized, and to
use higher order functions to stitch these together.
An example of this kind of approach, which is ha
My preferred approach is to check the generation script into source
control, and add it to Cabal's extra-source-files section. If the
generated file is a standard .hs module, Cabal should add it to the
sdist automatically.
You might want to add a note to the README documenting how to
regenerate th
I'm working on a small Haskell package. One module in particular
contains so much boilerplate that rather than write the code myself, I
wrote a small Haskell program that autogenerates it for me.
What's the best way to package this for Cabal? Just stick the generated
file in there? Or is there
16 matches
Mail list logo