Fog Creek Software
Discussion Board




Ant and Make - Why did Ant win?

I have a theory about this. Well, if I didn't I wouldn't be posting would I:) It attempts to explain the success of Ant using the framework of the Innovators Dilema by Clayton M. Christensen. What I'm looking for is constructive (or otherwise) criticism of the explanation and your view on why Ant is now the build tool of choice for Java projects. I think it's pretty interesting that a new tool like this can take over the ecological niche of an existing and much more fully featured one. A possibly even more interesting question is, Is it possible to conciously design a program and surrounding "ecosystem" so that you can deliberately repoduce Ant's success? Anyway, here's the theory http://www.zanthan.com/itymbi/archives/000037.html

Alex Moffat
Thursday, May 09, 2002

I recently used ant for a project, windows 2000 was my OS,. This was the first time I was using a build tool, i found it easy to play around with build.xml and ANT.

never used make! is it possible to use make on Windows?

Prakash S
Thursday, May 09, 2002

I've never used ant. what is it?

arachnid
Thursday, May 09, 2002

Arachnid, please read the article's intro.

Alex, my views: 

* better PR -- linked in with whole extreme programming / XML movement, so people feel a moral imperative to use it
* many java programmers are inexperienced, so it's like a new market just opened up, one that doesn't favor Make in particular
* fits in with Java nature:  cross-platform and verbose; scalability/performance are acceptable tradeoffs for ease of use
* java programmers tend not to do things that would require build contortions, and they can extend ant with java tasks when they do

Java guy
Thursday, May 09, 2002

Answer: Make sucks.

Ok, a slightly longer answer:

Makefiles are basically a list of shell commands. As a result, it's next to impossible to write portable makefiles. It depends on what command shell is installed, and on the specific parameter lists of every tool that gets called from a makefile.

Add to that that make doesn't help at all in determining dependencies, make doesn't work very well over multiple directories, and the only way to extract information from a makefile is to run it, it's reasonable to decide to replace make.

Ant files are portable, the xml format means that you can use other tools to process them (for documentation, for example), and all you need to know is Java if you need to do something special.

Chris Tavares
Thursday, May 09, 2002

Actually, what I wrote doesn't satisfy me.  I wasn't interacting with your point.

"The innovator's dilemma" assumes the innovator is in competition with the startup.  But opensource projects are rarely in competition.  Java was the disruptive technology, and when these disruptive technologies come along, a new project is formed, instead of an old one scrambling to cover the market.

Java guy
Thursday, May 09, 2002

ok. cool. i think? so its just "make" for java? I guess that's a good thing. I hope I never have to use it...that would mean I'm working on a java project. ;-)

arachnid
Friday, May 10, 2002

Ant has probably taken over because of the integration it has with Java. If your building Java projects then it makes sense to write the management (building/etc) in a tool with similar syntax. It would be interesting to see how many non-Java projects use Ant.

I have just finished writing a Build tool for our project here at work. Unfortunately, its not in Java and I was also _not_ able to use makefiles (dont ask, you really dont want to know).

I have also looked at tools like JAM, which is very kewl as well.

Why did Ant make (excuse me) it so big: Integration and portability.

James Ladd
Friday, May 10, 2002

Prakash:
Yes,you can use make on Windows. For example it's included in Borland's C/C++. But this is not quite recommended. Well, IDE should have project management
Using command-line compiler is usually not a smart choice.

Java guy:
Well, I believe the "inexperienced" C/C++ programmers would not be less than those kind of Java programmers. Most undergrads learn both. It's not just a Java vs make issue. Even C/C++ programmers tend not to use old tools like make. (If you are using vi/gcc/make to develop projects, pease raise your hand. )

Well, in my humble opinion, programming should be as easy as possible. If ANT can do almost the same make does, and ANT needs less experience to use, ANT is definite a better choice.

My only rant is that those Java guys think Java is suitable for everything, but it's not. Writing a Java IDE in Java is just stupid.

S.C.
Friday, May 10, 2002

Actually, Make works fine over multiple directories...

It takes some setting up to do it, I admit, and VERY few people have learned how to use it to the extent that they can get it to work to that level.

{Me, I love make. I use it for all sorts of things - not just compiling software. It runs bits of my websites[1], it makes sure only the changed parts of my documents are re-LaTeX'd, it updates system components.
[1] Yes. Make works quite well as a content management system...}

I've found, wandering from company to company as I do, that almost no-one in the real world understands what Make does. They have a set of almost mystical beliefs in what happens, and a set of basic makefiles that were written back in the mists of time and now "almost work, but we can't touch them ever because everytime we do, everything breaks".

Make is, at heart, a stormingly simple tool and that makes it hugely powerful and enormously dangerous. The number of projects that end up building everything because they seem unable to understand how to use Make so it determines what to build is TERRIFYING. They might as well not be using make at all. People wrap make in shell-scripts to force it to iterate builds "until it works". People put loops in the scripts to iterate over directories rather than letting make work out whether to make the things or not... the list goes on and on and on.

It's not helped by the sheer number of manufacturers that ship broken implementations of Make. Oh, and lets not forget those people who ship broken makefiles with their products. Yes, Oracle, I'm looking at you. You horrible, horrible mass of incompetents. They're not alone, but they're trying REALLY, REALLY hard to be the worst...


The comments about the shell issues are 100% correct, Make's greatest failing is its reliance on shell commands. You do have a basic set of tools that you can expect to be present, especially on UNIX systems - because if they aren't there, the system isn't going to boot. (sh, sed, grep, things like that).

Another failing is this insistence on using "sh" to launch commands, and the resultant command length limitations coupled with C/C++'s refusal to search hierarchies for #include files, but here I'm really tilting at windmills...

{And I'm not sure writing 1000+ character command lines represents good practice.}



Why is Ant better? It's a point-and-click tool. It does what it needs to do when you take it out of the box.

Make belongs to an older generation of UNIX tools which essentially arrive non-functional with the assumption someone will set them up. If you have someone to do it, that's fine, but most places don't. Make could have this fixed by coming with "do sensible default things" makefiles for people to use, but it doesn't.

Ant is part of a newer generation of tools which arrives working, but you can alter it if you need to.

Katie Lucas
Friday, May 10, 2002

It is possible to write (relatively) portable Makefiles, but as Katie noted, make is not well known and not well understood across the industry.

But Make and Ant are far from being the only options; You could use tmake [ http://trolltech.com ] or bake from Peter Miller or a variety of others. For 95% of the C/C++ projects, tmake provides perfectly portable super-easy build management which I don't think either make or Ant can give.

Ori Berger
Friday, May 10, 2002

Alex,

I think you're overlooking learning curve.  A new product with a restricted feature set is easier to learn.

This is the whole philosophy behind Java's design.  Wasn't it described as C++-- once?  Ant follows in the same tradition.

The other issue is documentation.  I've tried in vain to learn make, but hours sent searching the internet has failed to turn up a good beginners tutorial.

I've found myself using dos batch files to compile by C++ projects using the Borland Command Line tools.  Make is included, and even has a help file, but I just can't figure it out.

Ant, on the other hand, is simpler, well documented and there are other newbies climbing a similar learning curve to give me comfort.

Ged Byrne
Friday, May 10, 2002

Just a Note:
There are also make and ant build tools for .Net projects:

nmake - built into .Net sdk

nant - ant for .net:
http://sourceforge.net/projects/nant/


I currently use nmake on my c# projects but I intend to switch to nant soon. I had good success in the past with Ant building my Java projects. I like it because the XML flavored syntax seems a little easier for me and I hate it when my build doesn't work because of whitespace/tabs using nmake.

Ian Stallings
Friday, May 10, 2002

Prakash S:

As others have commented make can be used on windows. Before
switching to ant I had makefiles setup at work to build a
1500 file java project. If you install cygwin you'll get
gnumake, which at least ensures you're using a cross
platform version.

Chris Tavares:

I'd take issue with "make doesn't help at all in determining
dependencies". In my opinion its handling of intertarget
dependencies is one of the two part of make that far exceed
ant. The other is make's ability to dynamically construct
targets at runtime. I've certainly had ant files with almost
duplicate targets that could be done in make in a much less
verbose way.

Java guy:

I think in the open source world the competition is for
mindshare, programming time and community growth. Sure there
generally isn't money at stake, at least initially, but a
successful and popular project is good for the ego, and the
resume.

arachnid:

Perhaps you could consider ant as an example where a
previously successful and widespread software product has
been pretty completely replaced, at least in one niche by
another. Do you have any examples from the non java world?

S.C.

Why not write a Java IDE in Java? NetBeans and Eclipse both
work and are getting better and better. They also both
provide very interesting and useful frameworks for
developing IDE type environments for other programming
environments, such as workflow or data conversion
engines. p.s. I don't count "it's too slow" as a valid
answer :)

Katie Lucas:

I agree. I'd hadn't thought about your point about make
being a tool that requires setup and I like your
generational remark. Your first brief exposure to software,
and how easily you can get it to do anything, really does
have a great impact on whether or not you'd like to continue
to use it. In the commercial world I always try to make the
whole experience of getting started as absolutely simple as
possible, users, including programmers, seems to need
instant reward and positive reinforcement. I blame video
games myself :)

Ged Byrne:

Good make documentation can be found for gnumake at
http://www.gnu.org/manual/make-3.79.1/make.html It's what
I've used in the past.

Thanks for the input.

Alex Moffat
Friday, May 10, 2002

Alex,

Thanks for the link.  I may understand Make yet.

Ged Byrne
Friday, May 10, 2002

>> Is it possible to conciously design a program and surrounding "ecosystem" so that you can deliberately repoduce Ant's success? <<

At the end of the footnotes of a link I just submitted to another topic, there is this curious passage:

"EMACS could not have been reached by a process of careful design, because such processes arrive only at goals which are visible at the outset, and whose desirability is established on the bottom line at the outset. Neither I nor anyone else visualized an extensible editor until I had made one, nor appreciated its value until he had experienced it. EMACS exists because I felt free to make individually useful small improvements on a path whose end was not in sight."
[ http://www.oreilly.com/openbook/freedom/ch06.html ]

----

Now, if you look at the history of Ant, you will read:

"Initially, Ant was part of the Tomcat code base, when it was donated to the Apache Software Foundation. It was created by James Duncan Davidson, who is also the original author of Tomcat. Ant was there to build Tomcat, nothing else.

"Soon thereafter, several open source Java projects realized that Ant could solve the problems they had with Makefiles. Starting with the projects hosted at Jakarta and the old Java Apache project, Ant spread like a virus and is now the build tool of choice for a lot of projects."
[ http://jakarta.apache.org/ant/faq.html#history ]

Often you hear that accidents snowball.  Linux was used to pass time before HURD, Knuth thought he would bodyslam TeX over the summer.  How does one bottle these things, except by being a creative person who doesn't mind breaking with convention?

Sammy
Friday, May 10, 2002

Alex,

Why not write a Java IDE in Java? NetBeans and Eclipse both work and are getting better and better. They also both provide very interesting and useful frameworks for
developing IDE type environments for other programming
environments, such as workflow or data conversion
engines. p.s. I don't count "it's too slow" as a valid
answer :)

I guess we should start a new thread...

Why "it's too slow" not valid? The first time I tried Forte it took like a day to start up. The GUI response was slow like hell. It also ate up all my memory. I don't mean it is impossible to write an IDE in Java. I just mean that Java is not the appropiate tool for this, at least for now.

Maybe in the future when we have faster machines, better VM, etc., a Java IDE in Java will be okay. Just hope Java won't be killed by C# before this happens.

S.C.
Friday, May 10, 2002

S.C.

That was my initial experience a year or so ago. I've recently tried NetBeans again, same computer, same jvm and things are much faster.  With 1.4 it's even better. Sure, it doesn't match emacs for speed or flexibility but it's a fine IDE. For C# to overtake Java it needs to displace J2EE, client side Java is a nice to have, it's getting faster and faster and IMHO it's good enough. On the server Java is the current leader, the question is can C# win there? To do so Microsoft needs to overcome the anti MS feeling in many big development shops. If you run any unix you're going to fight hard to go java rather than C#, if you don't like MS tatics in general, you're going to go java rather than C#, if you use IBM, BEA etc. you're going to use java. Can MS overcome this? Perhaps but it's not a sure thing.

Alex Moffat
Friday, May 10, 2002

Java has also managed to get itself spec'd into OpenCable (OCAP)  (see http://www.opencable.com) and DVB MHP (Multimedia Home platform, see http://www.mhp.org).  They are pretty much the same thing, except that OCAP is extended to meet the requirements of cable operators in N. America, which MHP is the rest of the world.

While ahead of its time (that's a polite way of saying bleeding edge, too fat, and too slow) it is what it is, its written down, and people have agreed to build to it.  Java continues its roll...

Nat Ersoz
Friday, May 10, 2002

One really annoying problem with "make" for Java development is that the "$" syntax for Java inner class files conflicts with make's variable syntax.  And then it conflicts again with Unix or Cygwin shell variable syntax.

rwh
Tuesday, May 14, 2002

"$" should be disallowed in any syntax.  What a butt-ugly thing to have in anything outside of double quotation marks...

Nat Ersoz
Tuesday, May 14, 2002

Oh, except for Makefiles, "$" somehow fits the context...

Nat Ersoz
Tuesday, May 14, 2002

load"$",8,1

dunno wair
Tuesday, May 28, 2002

I feel that the top 3 reasons that Ant succeeds is that it is much simpler,
much easier to figure out (build.xml vs makefile),
and
cross platform.

Other than that, ant *IS* make... the basic theory behind both tools (hint, the dependency graph) is the same...

a make is a make is a make...

Amir Kolsky
Tuesday, May 28, 2002

I am discovering ant.

But I still don't know if it can be used to compile C++ or if it is only for Java ...

Thibaut Bultiaux
Tuesday, April 29, 2003

I like GNU make.  I am currently using it for set of multi-directory projects but I agree that its dependence on the Unix environment is occasionally annoying.

The multiple directory handling fits in well with the Unix way of doing things but gets in the way once in a while.  The fact that the 'wildcard' function is broken doesn't help very much either.

I don't know about Ant, but I find that gmake is way too verbose by default.  I have to use lots of tedious workarounds to make it shut up.

Gmake also needs a more structured 'include' and template mechanisms.  It treats everything like a string of characters and reparses them every time.  While this allows for clever and gratifying tricks and could pave the way for an Obfuscated Makefile Code Contest, it does more harm than good.

However, I have actually tried switching to Ant but I just couldn't get to like it (and I'll probably go and read some more Ant docs after this).  Some of it may have to do with the fact that I don't like XML.  I don't think it's just the teenage anti-establishment-style dislike, either.  I find XML-tagged configuration really hard to read because all structure is explicitly tagged (XML is great for document-like things, though).  This is probably because I'm using a regular text editor, but I really like being able to use a regular text editor on Makefiles.

Katie Lucas:

In a way, Make does have defaults but they aren't too helpful.  It comes with "implicit rules" to compile C programs with the 'cc' comand.  However, I haven't figured out how to make it use compilation flags that I want.  Most of the time, I forget to create a complete set of compilation rules and the implicit rules end up running when I don't want them to.

Kannan Goundan
Saturday, May 10, 2003

I didn't see it mentioned that ant can compile java projects much faster since all compilations can occur in a single process/JVM.  We have a large java project that compiles in about 10 minutes using make but in under 2 minutes using ant.

Chris Mayor
Sunday, June 01, 2003

Then you are misusing make. It's quite easy to achieve the same effect (build all the source files with one invocation of javac) with make.

Mark
Tuesday, July 29, 2003

Chris, Mark:

Yes, it isn't too difficult to coalesce multiple compiler invocations into a single one, but it really shouldn't be necessary.  However, Ant's advantage in this area is incidental.

One thing you can do is use a faster compiler (like IBM's Jikes) or use a separate tool to keep the compiler loaded and ready to go.  The real problem here is Java's startup time which, for small compiles, makes Ant slower than GMake + Jikes.

Kannan Goundan
Tuesday, September 02, 2003

Check out the Universal Makefile at http://geosoft.no/javamake.html.  Ant requires a JRE, but one may not always be available.

Michael Daudel
Thursday, October 30, 2003

*  Recent Topics

*  Fog Creek Home