www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - breaking changes: how gofix solved the problem of automated code

--089e0118289e821c5804dd992557
Content-Type: text/plain; charset=ISO-8859-1

There is a dilemma of having to choose between:
A) getting stuck with bad names / apis / language issues forever
B) making painful breaking changes that breaks existing code

See recent D threads for all the polemics this creates on (in)stability of
D.

GO avoids this dilemma with the correct approach, IMO: automation of code
transition.
See this article for details on gofix:
http://blog.golang.org/2011/04/introducing-gofix.html

gofix operates on the AST of the code and performs AST manipulations (no
fragile 'sed' / regex based bash scripts!), followed by printing them back
to the source code. This is made possible by gofmt, which formats source
code.

Here's a snippet from the article:

"Gofix has already made itself indispensable. In particular, the recent
reflect changes would have been unpalatable without automated conversion,
and the reflect API badly needed to be redone. Gofix gives us the ability
to fix mistakes or completely rethink package APIs without worrying about
the cost of converting existing code."

This is what we need for D if we want to avoid getting stuck in this
dilemma.

--089e0118289e821c5804dd992557
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div>There is a dilemma of having to choose between:</div><div>A) getting s=
tuck with bad names / apis / language issues forever</div><div>B) making pa=
inful breaking changes that breaks existing code</div><div><br></div><div>
See recent D threads for all the polemics this creates on (in)stability of =
D.</div><div><br></div><div>GO avoids this dilemma with the correct approac=
h, IMO: automation of code transition.</div><div><div>See this article for =
details on gofix: <a href=3D"http://blog.golang.org/2011/04/introducing-gof=
ix.html">http://blog.golang.org/2011/04/introducing-gofix.html</a></div>
<div><br></div></div><div>gofix operates on the AST of the code and perform=
s AST manipulations (no fragile &#39;sed&#39; / regex based bash scripts!),=
 followed by printing them back to the source code. This is made possible b=
y gofmt, which formats source code.</div>
<div><br></div><div>Here&#39;s a snippet from the article:</div><div><br></=
div><div>&quot;<span style=3D"background-color:rgb(255,255,255);color:rgb(5=
1,51,51);font-family:Arial,sans-serif;font-size:13px;line-height:20.796875p=
x">Gofix has already made itself indispensable. In particular, the recent r=
eflect changes would have been unpalatable without automated conversion, an=
d the reflect API badly needed to be redone. Gofix gives us the ability to =
fix mistakes or completely rethink package APIs without worrying about the =
cost of converting existing code.&quot;</span></div>
<div><span style=3D"background-color:rgb(255,255,255);color:rgb(51,51,51);f=
ont-family:Arial,sans-serif;font-size:13px;line-height:20.796875px"><br></s=
pan></div><div><span style=3D"background-color:rgb(255,255,255);color:rgb(5=
1,51,51);font-family:Arial,sans-serif;font-size:13px;line-height:20.796875p=
x">This is what we need for D if we want to avoid getting stuck in this dil=
emma.</span></div>
<div><br></div>

--089e0118289e821c5804dd992557--
May 25 2013