Hmm, Buildtool... one of my pet projects, probably the one on which I've spent the most time working... and it was even starting to get some (few) popularity lately

But I must admit it. The code is, in its actual form, dead :-( It's unmanageable (shell scripting doesn't scale, you know) and breaks in many, many places. Just consider the following facts:

  • Detection of C++ features from bt_config fails in many cases.
  • bt_logic's behavior is less than acceptable, and adding functionality to it is a PITA.
  • Several modules haven't been modified across versions, so they don't work properly. For example, bt_lint is almost useless.
  • Shared library handling is broken in many systems, and fixing it could be very difficult.
  • The code exposes internals too much, specially in environmental variables and C/C++ defines. But cleaning that up is also complex due to the nature of shell scripts.
  • I was suggested recently to make bt_dist only include in tarballs what was really needed, and not everything (just like GNU Automake's make dist does. I like the suggestion, but implementing correctly is impossible due to the current code.

... plus a large etcetera. All in all, too many problems that can't be solved without doing very gross hacks or restarting the project from scratch. This is why I haven't touched the code since the beginning of the summer.

But... you know what? For some reason, I'm willing to rewrite it from scratch. Of course, using a real programming language. The choices I have in mind are ("obviously" ;-):

  • C++: I really like C++, together with the STL. Yes, believe me! It simplifies programming a lot, and OOP is wonderful. But I'm a bit afraid of portability. If I use this, it must follow the ANSI standard (not doing so could be silly), which means that users will need a compiler that follows the standard, such as GNU GCC. This is not a big problem, since GCC compiles almost anywhere, but may add problems to end users. However, by the time the program is usable, the situation may have improved a lot, hehe.
  • C: Very portable, assuming you know where the portability problems arise (not a big problem for me). But what really bothers me is that it slows down development a lot: I'd have to create my own classes to handle containers (hash tables, linked lists, etc.) and handle dynamic memory even for trivial tasks. I'd also loose polymorphism, inheritance, exceptions... Ok, ok, GNOME emulates OOP in C, but I'm not too keen on that.

If I can't find any strong reason not to use C++, I'll stick to it. In fact, I've already written a bit of code (program detection) and it has been easy :-)

Oh, I listen, "How could build scripts be?". Well, I have XML in mind - something similar to Apache Ant. Otherwise I'll have to invent and write a parser for a custom language (ew, not funny). But that's something yet to decide.

Go to posts index

Comments from the original Blogger-hosted post: