ANN: Call for Participation - Code Generation 2008

With an emphasis on providing practical advice, Code Generation 2008
is the ideal opportunity for architects, developers and others to
understand how to benefit from emerging tools and technologies in the
broad area of Code Generation.

Call for Participation:

The full programme for June's CG2008 event is now available. 34
sessions will be presented by 30 industry veterans with a backgroound
of successful project delivery.

Advertisements

On Feb 29, 3:56 am, Mark Dalgarno <> wrote:
> With an emphasis on providing practical advice, Code Generation 2008
> is the ideal opportunity for architects, developers and others to
> understand how to benefit from emerging tools and technologies in the
> broad area of Code Generation.

ROFL.
> The full programme for June's CG2008 event is now available. 34
> sessions will be presented by 30 industry veterans with a backgroound
> of successful project delivery.

Mentally-deranged buffoons, stumbling in the dark in search of an exit
out of computing, drumming up seminars on decades-old hacks.

You have wonderful intuition regarding in which newsgroups to post
this.

None of the languages Java, C++ or C give the programmer compile-time
access to a data structure representing the program, and so any
metaprogramming consists of generating text which has to be lexically
analyzed into tokens from scratch.

The Unix guys perfected this hackery years ago:

From the preface _Compilers: Principles, Techniques and Tools_, 1986:

``This book was phototypeset by the authors using the excellent
software available on the UNIX system. The typesetting command read

pic <files> | tbl | eqn | troff -ms

pic is Brian Kernighan's language for typesetting figures; we owe
Brian a special debth of gratitude for accomodating our special and
extensive figure-drawing needs so cheerfully. tbl is Mike Lesk's
langauge for laying out tables. eqn is Brian Kernighan's and Lorinda
Cherry's language for typesetting mathematics. troff is Joe Ossanna's
program for formating text for a phototypesetter ...''

Advertisements

Guest

Please do not cross post like this in the future. Every one of these
boards is appropriate for this topic. There is no need to be a troll
about it.

On Mar 1, 1:26 pm, Kaz Kylheku <> wrote:
> ROFL.

I don't know whether to admire you for having enough free time to
write the same tedious old code over and over again, or to feel bad
for you because while you are sitting there spending days coding the
same stuff you've been coding repeatedly for years, I've already
started, developed, and completed projects for 5 different clients.

Once you get over the common, but incorrect, idea that source files in
any language only have value if you create them from scratch, you
start to see the value in using valuable tools to do a lot of your
work for you. Eventually, once you get enough experience, the
usefulness of these kinds of things will become clear to you. I
promise, they make you more 1337, not less, so you don't have to worry
about that.
> Mentally-deranged buffoons, stumbling in the dark in search of an exit
> out of computing, drumming up seminars on decades-old hacks.

Stumbling in the dark searching for an exit out of tedious,
repetitive, time-wasting tasks, maybe. You spend days coding up a GUI,
I spend seconds putting it together in C++ Builder. You spend hours
writing a parser for a scripting language you've invented, I spend
minutes tossing a grammar together with flex/bison. 22 years ago, you
spend months typesetting your book, finding mistakes, going back,
fixing, reprinting, doing whatever it is you are doing... but all I
need to do is edit a few lines of script and type:

pic <files> | tbl | eqn | troff -ms

Too bad your book came out 6 months after mine, and all the time you
spent working on it ended up wasted (a theme that seems to be common
with the projects on your web site, as well -- everything is either
outdated or "experimental", nothing really on the "useful" side --
perhaps you should consider using your talents to improve existing
tools rather than reinventing the wheel, it's a waste of a good mind).
> You have wonderful intuition regarding in which newsgroups to post
> this.

It's pretty relevant. Not only that, but it's a topic that you'd
imagine a large amount of subscribers to these newsgroups may be
interested in. Your attitude suggests that you have a hard time
stepping out of your super-logical box; things like "people reading
comp.lang.c++ are interested in things besides c++ syntax (or whatever
newsgroup)" and "you do not have to spend all your time typing your
own code over and over again" and "code generation makes you less of a
h4x0r" do not make sense to you. This is OK. It's actually a very
common attitude among programmers, so I understand where you are
coming from. But you should be aware of your mental limitations
(which, while common, are also severe) and your tendency to think like
a robot sometimes before trolling on boards like these.

You have successfully managed to show not one, not two, but five
different Usenet groups that Kaz Kylheku can not think outside of his
small, small box. Had any projects on your web site had any
significance aside from some useful contributions to POSIX threads
(it's a shame that's all you've managed to do so far -- and if you
didn't do it, somebody else would have done it just as well), and had
"kazlib" managed to pull in more than 10 Google results, I may have
reconsidered having some amount of respect for what you do and say.

On top of that, being as "experienced" as you would have us believe,
you should know better than to troll 5 newsgroups at once.

"" <> writes:
> You have successfully managed to show not one, not two, but five
> different Usenet groups that Kaz Kylheku can not think outside of his
> small, small box. Had any projects on your web site

I'm afraid, Jason, that you've rather mistaken Kaz's response to a
troll for the original troll itself. Kaz is actually a
highly-respected regular over at c.l.c; though why he actually
bothered writing a response to this hapless troll is far beyond
me. Perhaps you missed (or already dismissed) the original post.

Guest

On Mar 1, 2:35 pm, Micah Cowan <> wrote:
> "" <> writes:
> > You have successfully managed to show not one, not two, but five
> > different Usenet groups that Kaz Kylheku can not think outside of his
> > small, small box. Had any projects on your web site
>
> I'm afraid, Jason, that you've rather mistaken Kaz's response to a
> troll for the original troll itself. Kaz is actually a
> highly-respected regular over at c.l.c; though why he actually
> bothered writing a response to this hapless troll is far beyond
> me. Perhaps you missed (or already dismissed) the original post.

If that is the case then I apologize to Kaz. Mark Dalgarno's post
looks completely reasonable to me. With comments like "ROFL" to a
reasonable sounding post, I'll just have to take your word for it on
Mr. Kylheku's credibility.

jason.cipriani wrote:
> On Mar 1, 1:26 pm, Kaz Kylheku <> wrote:
>> ROFL.
>
> I don't know whether to admire you for having enough free time to
> write the same tedious old code over and over again, or to feel bad
> for you because while you are sitting there spending days coding the
> same stuff you've been coding repeatedly for years, I've already
> started, developed, and completed projects for 5 different clients.

Farbeit from me to defend Kaz, but my projects are either different, or I
re-use my code on them.

Their differences should go into metadata and scripts, and their
commonalities should merge into a core, typically accessed by an API using a
DSL. A good system for this is called "Software Product Lines".

So this suggests that we should prefer languages that make DSLs easy.
> Once you get over the common, but incorrect, idea that source files in
> any language only have value if you create them from scratch, you
> start to see the value in using valuable tools to do a lot of your
> work for you.

Either way, the ideal is to add features by writing high-level code. Putting
a code generator over a hard language would create a big impedence mismatch.
As soon as you need something the generator can't do, you switch languages.

And generation happens all the time in "templates", which bond two
completely different kinds of languages. Consider PHP or Ruby inside <%%>
tags, in HTML.

On Mar 1, 7:23 pm, ""
<> wrote:
> On Mar 1, 1:26 pm, Kaz Kylheku <> wrote:
>
> > ROFL.
>
> I don't know whether to admire you for having enough free time to
> write the same tedious old code over and over again, or to feel bad
> for you because while you are sitting there spending days coding the
> same stuff you've been coding repeatedly for years, I've already
> started, developed, and completed projects for 5 different clients.

It seems to me that you (Jason) have completely missed the point
that Kaz is making. Here's my attempt to summarize:

OP: (not quoted by jason) Code generation is a brand new emerging
technology!
KAZ: It is not new, it was in widespread use 20 years ago, but you
didn't notice.
Jason: Kaz, you're an old hack who spends all your time re-inventing
the wheel.

The examples Kaz gave are demonstrations of the technique employed
to avoid re-implementing the wheel. How you interpreted that as
an indicator that he reinvents the wheel for each project is,
to me, an good example of completely missing the point.

Guest

On Mar 1, 9:33 pm, "Phlip" <> wrote:
> Farbeit from me to defend Kaz, but my projects are either different, or I
> re-use mycodeon them.
>
> Their differences should go into metadata and scripts, and their
> commonalities should merge into a core, typically accessed by an API using a
> DSL. A good system for this is called "Software Product Lines".
>
> So this suggests that we should prefer languages that make DSLs easy.

Maybe, but not necessarily in the general case -- there are many other
reasons to prefer certain languages over others: familiarity and
appropriateness for the task at hand being the two biggest reasons I
can think of. A general preference for certain types of languages in
all situations isn't a good idea. It may be difficult, say, to develop
a DSL on top of an existing DSL, but that doesn't mean we should
prefer to not use DSLs in general (for example). We should prefer
languages that let us express the problem we're trying to solve as
clearly and concisely as possible. (When I say "languages" I don't
mean just ones you would type with characters, I also mean tools like
a code-generating GUI editor, or something like Max/MSP, which also
let you express problems albeit in a more graphical sense -- it's hard
to build a DSL on Max/MSP but Max is still a good tool for certain
types of tasks).
> [snip] ... Putting
> acodegenerator over a hard language would create a big impedence mismatch.
> As soon as you need something the generator can't do, you switch languages.

Yes, but if you are using a code generator where you consistently have
to "step outside" of it and add lower-level code, you are probably
using the wrong tool for the job. For example, if you are using flex
but you consistently hand-edit the generated state machines (or
whatever) by adding various features that you can't express in flex,
you may want to consider not using flex (especially if you have to end
up reapplying the same modifications every time you modify the
original flex input). On the other hand, a good code generator would
integrate well into the underlying language and would allow you to
"safely" do things the generator could not do by adding low-level code
that didn't conflict with what the generator was doing. For example,
ratfor (the old Fortran preprocessor), or FLUID (http://www.fltk.org/
shots.php - FLTK's drag-and-drop GUI editor) -- both of these let you
use the code generator as a convenient tool to help with a task,
rather than giving you a "tool" with a lot of limitations that you
must consistently fight with (there are many "bad" tools like this
around, as well -- I see it a lot especially in programs designed to
generate source from UML, for some reason).

Guest

On Mar 2, 6:22 am, William Pursell <> wrote:
> It seems to me that you (Jason) have completely missed the point
> that Kaz is making. Here's my attempt to summarize:
>
> OP: (not quoted by jason)Codegenerationis a brand new emerging
> technology!
> KAZ: It is not new, it was in widespread use 20 years ago, but you
> didn't notice.
> Jason: Kaz, you're an old hack who spends all your time re-inventing
> the wheel.
>
> The examples Kaz gave are demonstrations of the technique employed
> to avoid re-implementing the wheel. How you interpreted that as
> an indicator that he reinvents the wheel for each project is,
> to me, an good example of completely missing the point.

Again; if you say so, sure. I see things like "ROFL", phrases such as
"stumbling in the dark in search of an exit
out of computing" (an exit out of computing?), comments about
inappropriate newsgroups to post in, and a restatement of the obvious
("metaprogramming consists of generating text which has to be
lexically analyzed into tokens from scratch"). He followed his
typesetting example (assuming that is the example you are referring
to) with a comment "scan, parse, munge, etc.". I don't read that as
"this is an example of something good" (do you?), I read that as
"here's yet another example of useless code generation, blah blah
blah, same old useless stuff adding extra layers of parsing and
munging and parsing again". If I misinterpreted that, well... there's
nothing I can do except suggest that Kaz not say the opposite of what
he means. I see nothing in Kaz's post that isn't harshly critical of
code generation as a whole and also of the specific seminar cited in
the original post...

If he did mean the opposite of what it looked like he was saying,
well, maybe in the future Kaz can be a little clearer. So again, I'll
take your word for it on his credibility. I see nothing except
baseless attacks, sarcasm, and troll-speak in his post.

In article <>, <> wrote:
....
>If he did mean the opposite of what it looked like he was saying,
>well, maybe in the future Kaz can be a little clearer. So again, I'll
>take your word for it on his credibility. I see nothing except
>baseless attacks, sarcasm, and troll-speak in his post.

Jason:

Welcome to comp.lang.c (aka, clc). This is a unique environment, with
some truly brain-damaged people, known as "regulars". They form a
Clique, that is utterly resistant to reason or change.

There is also the "clc-effect", where something innocuous (e.g., this
very thread) is posted to many groups, including clc, and all the
responses come from clc. It is truly a phenomenon to be enjoyed, but
don't take any of it seriously.

The generally held theory is that many of the so-called "clc regulars"
have some variation of Aspergers syndrome. It explains a lot of their
behavior.

Kenny McCormack wrote:
> In article <>,
> <> wrote:
> ...
>
>>If he did mean the opposite of what it looked like he was saying,
>>well, maybe in the future Kaz can be a little clearer. So again, I'll
>>take your word for it on his credibility. I see nothing except
>>baseless attacks, sarcasm, and troll-speak in his post.

I dismissed the OP almost instantly even though I am interested
in and work in the field of code generation -- too much "new,
hot, cool, and next week we'll invent cutting homogeneously
wide pieces off bread" for my taste.
Maybe Kaz reacted to the same key stimuli differently.
FWIW I did understand his response in a different way than you.
> Jason:
>
> Welcome to comp.lang.c (aka, clc).

Welcome indeed. Now meet our resident troll:
> This is a unique environment, with
> some truly brain-damaged people, known as "regulars". They form a
> Clique, that is utterly resistant to reason or change.
>
> There is also the "clc-effect", where something innocuous (e.g., this
> very thread) is posted to many groups, including clc, and all the
> responses come from clc. It is truly a phenomenon to be enjoyed, but
> don't take any of it seriously.
>
> The generally held theory is that many of the so-called "clc regulars"
> have some variation of Aspergers syndrome. It explains a lot of their
> behavior.

In technical terms, a Target learns enough about a newgroup's topic, and
enough about its regulars, to always know how to stir up a reaction.
Examples: Posting to an OO newsgroup that OO sucks and database tables are
better for dependency management. That's enough to stimulate anyone to
lecture what OO is and what's good and bad for.

Phlip wrote:
>>> Welcome indeed. Now meet our resident troll:
>>
>> I just don't know who to trust anymore.
>
> Typical newsgroup dynamic.
>
> Kaz is probably an Admin personality:
>
> http://redwing.hutman.net/~mreed/warriorshtm/admin.htm
>
> That also implies he's always factually correct, and hence
> unassailable on technical grounds, so the other regulars begrudgingly
> ally with him. That's important with a super-complex language like C.
>
> Next, every newsgroup has one of these:
>
> http://redwing.hutman.net/~mreed/warriorshtm/target.htm
>
> In technical terms, a Target learns enough about a newgroup's topic,
> and enough about its regulars, to always know how to stir up a
> reaction. Examples: Posting to an OO newsgroup that OO sucks and
> database tables are better for dependency management. That's enough to
> stimulate anyone to lecture what OO is and what's good and bad for.
>
> Not sure which kind this "resident troll" is.

On Mar 2, 3:22 am, William Pursell <> wrote:
> On Mar 1, 7:23 pm, ""
>
> <> wrote:
> > On Mar 1, 1:26 pm, Kaz Kylheku <> wrote:
>
> > > ROFL.
>
> > I don't know whether to admire you for having enough free time to
> > write the same tedious old code over and over again, or to feel bad
> > for you because while you are sitting there spending days coding the
> > same stuff you've been coding repeatedly for years, I've already
> > started, developed, and completed projects for 5 different clients.
>
> It seems to me that you (Jason) have completely missed the point
> that Kaz is making. Here's my attempt to summarize:
>
> OP: (not quoted by jason) Code generation is a brand new emerging
> technology!
> KAZ: It is not new, it was in widespread use 20 years ago, but you
> didn't notice.
> Jason: Kaz, you're an old hack who spends all your time re-inventing
> the wheel.

Generating source code text is only an implementation strategy for
writing compilers, when you don't have any other interface to target
language.

I only invoked the old guys as an example of how the use of code
generation was already mature long ago, not to criticize them.

I could have chosen these examples instead: high level languages that
are compiled by translating to C. C++ started out as ``C with
classes'', whose compiler put out C code. Some later C++ compilers
worked that way too. That implementation strategy has been used for
other languages, such as Eiffel and Kyoto Common Lisp and its
derivatives.

Should therefore C++ be regarded as a work of code generation? Is that
what is interesting about C++? Is Stroustrup's contribution to
computing that he wrote a program that wrote source code that was fed
to another program? What about the actual semantics of C++?

What is this state of the art of code generation that these people are
trying to adavnce who are getting together for this seminar in
Cambridge, and how does their state of the art really compare to
ancient projects like C with classes, or those pipeline-able Unix
utilities for typesetting? The old guys had code generation down pat
(and they aren't going to the conference).

But I also have another subtle point: namely that text-based code
generation is not only just an implementation kludge when you don't
have an alternate interface; but because it's a kludge, the technique
has no state of the art. To conduct conferences about its advancement
is folly.

The right way to do metaprogramming is with data structures
representing a program, not with character strings representing a
program.

Examples: Lisp and Scheme macros, C++ templates.

The state of the art in code generation has for decades now not
involved writing stuff into files and invoking compilers on it.

That remains the ``state of the kludge'', which, of anyting, requires
gradual retirement, rather than advancement.
> The examples Kaz gave are demonstrations of the technique employed
> to avoid re-implementing the wheel. How you interpreted that as
> an indicator that he reinvents the wheel for each project is,
> to me, an good example of completely missing the point.

Analogy:

Hacker: An international conference on code indentation? ROFL

Goof: What are you laughing at, disrespectful ass? I feel sorry
for the people that have to maintain with your unindented
code!
Way to undermine your credibility.

Hacker: WTF?

And must I have credibility to ROFL? What is credibility? It's the
degree to which we can trust someone's statement of /fact/ without
consulting another source. It has nothing to do with opinions. If say
that generating source code is a fragile, inefficient, limited hack
arising from the target language not giving you a hooks for
manipulating code as data, that is merely my opinion. It is not a
statement of fact. So, in making that statement, I am not using up my
credibility cookies, except to the extent that my opinion might reveal
stupidity or ignorance of the subject matter (which is relevant to
credibility because stupidity and ignorance are undeniably linked to
poor fidelity in the internalization and regurgitation of facts).

And I do in fact have a fairly strong background in code generation.

In my undergraduate days, I took a hands-on course in operating
systems. The class was crowded, and we didn't have enough Sun 2 boxes
(Motorola 68010) on which to run our code. So I decided to write an
emulator. At the core of the emulator was a giant switch statement to
dispatch funtions to opcodes. Of course, I didn't write and maintain
it by hand; I wrote a code-generating script. The input to the script
was a specification using regular expressions on strings of 1's and
0's to match instruction bit patterns and assign them to named
instruction groups. I could handle a family of instructions with one
function by writing a pattern that matches them all and assigns them
to the same group. The generated switch statement would capture all
possible opcode values to the same case. If I wanted the switch to do
more decoding and the handlers to do less (for more speed), I would
break up the group into finer pattern matches.

So for someone to accuse me of repetitively coding everything without
ever making the machine doing all the work is ridiculous.

I had my love affair with lex and yacc too; it didn't last very long
after graduation. I've produced maybe a dozen lex and yacc jobs. I
know I've written more than one hack where some condensed data file
was translated into static C data structures, making that data
available as part of a program's image.

My current company uses an in-house developed technology (rather large
and ambitious) based on code generation. I'm not the principal author,
but I had my fingers in it.

I have lots of experience hacking with text-based macro preprocessing
like m4 (and even wrote a macro preprocessor that was intended to be
superior to it). And of course, I have lots of experience with real
metaprogramming in Lisp: code that writes code, and even code that
writes code that writes code (all without converting anything to
characters that have to be lexed again).

On that harshly-criticized old web site of mine, there are some
projects which are orphaned pages, like this one:

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!