Sign In
[Profoundly Esoteric Image]
GarethJ's WebLog - Code generation and abstraction
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Email Blog Author
Share this
RSS for posts
RSS for comments
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
Built with DSL Tools
Code samples
Community
DSL Tools
Enterprise Development
Fun
Metablog
Modeling
Pages
Razor
Sounding off
SP1
T4
Tech thrills
The real world
UML
Visual Studio
VSX
Archive
Archives
November 2011
(1)
September 2011
(1)
June 2011
(1)
May 2011
(1)
April 2011
(1)
March 2011
(2)
January 2011
(6)
December 2010
(2)
August 2010
(1)
June 2010
(1)
April 2010
(2)
March 2010
(1)
October 2009
(1)
September 2009
(6)
May 2009
(3)
February 2009
(4)
January 2009
(2)
November 2008
(6)
October 2008
(5)
September 2008
(3)
July 2008
(2)
May 2008
(4)
April 2008
(4)
March 2008
(2)
February 2008
(9)
January 2008
(9)
December 2007
(6)
November 2007
(1)
October 2007
(3)
September 2007
(5)
August 2007
(3)
July 2007
(3)
June 2007
(5)
May 2007
(6)
April 2007
(1)
March 2007
(2)
February 2007
(5)
January 2007
(3)
December 2006
(2)
November 2006
(2)
October 2006
(3)
September 2006
(3)
August 2006
(2)
July 2006
(2)
June 2006
(5)
May 2006
(1)
April 2006
(3)
March 2006
(1)
February 2006
(3)
January 2006
(3)
December 2005
(10)
November 2005
(5)
October 2005
(3)
September 2005
(8)
August 2005
(2)
July 2005
(4)
June 2005
(5)
May 2005
(6)
April 2005
(2)
March 2005
(4)
February 2005
(4)
January 2005
(5)
December 2004
(9)
November 2004
(4)
October 2004
(13)
August 2004
(4)
July 2004
(2)
Full code generation
MSDN Blogs
>
[Profoundly Esoteric Image]
>
Full code generation
Full code generation
GarethJones
4 Apr 2006 11:12 AM
Comments
4
I said in a recent post that I didn't believe in 100% code generation in the near future.
The recent discussion about the worth/necessity of some volume of custom code to do clever IDE integration of a DSL got me thinking harder about whether I feel strongly about the notion of "Full code generation".
This phrase gets bandied about quite a lot as a selling point of Domain-Specific Modeling (particularly over traditional UML modelling) and as a concept I'm always drawn to it - even if only from the point of view of doing what folks often say can't be done.
Now discounting GUI builders where I wasn't in control of the code generation, my personal experience of using DSLs to build production software really started back when recreating all of the metadata and templates for a web content management system that generated ASP pages. That was certainly up in the high 90s percentage range for code generation as we only had a couple of hand-written pages in total, but the generated code was really very repetitive with just combinatorial problems to solve.
However, lately my viewpoint has of course been heavily skewed by the fact that the DSL I use and extend on a daily basis is a DSL for building DSLs (and I say "use", not just "build" because by the process of bootstrapping we build a large proportion of our DSL-building tools with themselves).
I'm absolutely guessing here, 'cos we're in an intermediate stage on our current build cycle so I can't measure, but I'd say we'll generate about 70% of the code in the designer I'm currently working on. This is a big step up from where we were in previous builds. Looking at my approaches to implementing the code that's currently not generated, I'm finding that I have about a 20/80 split between extending the DSL and generators to create my new functionality and adding the new code manually. So if I'm right here, we might get up to about 75%.
That's a pretty poor hit rate for a DSL guy I hear you cry.
I'd say it could be much higher with two strategies:
Build a DSL specifically designed for building DSL-building tools - Currently we use the same tools we ship, i.e. a DSL for building any other DSL. A DSL more specific to our internal problem domain might for example have graphical tree manipulation operations built in to deal with operations across our double-tree notation.
Build a DSL that allowed rich Windows Forms to be directly mapped to our domain models in complex ways.
In all honesty, I might have taken a bet on that last 25% and done one or both of these things if we weren't bootstrapping. Building a DSL with a half-in-pieces DSL toolset that then builds itself is a great proving strategy, but it is nothing like as productive as using finished or even CTP-quality tools.
We're very much still learning about the best work processes for this level of bootstrapping.
For the keenly interested, currently we do about half of the modelling using a DSL built on the previous stable version and the other half by editing the raw xml of the new DSL (defined in itself).
So the $64K question is "Would getting to full code generation really change my current worldview?"
Many folks suggest that with full code generation comes the ability to largely ignore the generated code and focus solely on the models. The comparison with compilers is often made here as these days relatively few people have to pay attention to intermediate code or assembler.
I buy the spirit of this, but I don't believe the practice would work out for me either now or back with my web content management system. Not enough of the other supporting systems that are involved in software development are prepared to understand my custom abstractions. I'm talking debuggers, profilers, browsers, symbol stores, style checkers, refactoring tools etc. here. Code generation and compilers are such a small part of the picture of development. While we don't have all these other pieces, then I think the difference between 75% and 100% is largely meaningless.
What we have at present is a damn good productivity tool, the best I've ever used in fact, but not a sea change in software development. This has already turned into an a bit of a novel so I'll break here and return to the topic of what needs to change anon.
4 Comments
Modeling
,
DSL Tools
Blog - Comment List MSDN TechNet
Comments
Loading...