Thursday, November 27, 2008

The Quest for Paladin Continues

...and I'm having a blast each step of the way. I wish code hackery were always this fun. In fact, I have to remind myself of the consequences of not taking breaks even though I'm in the zone and don't really want to. Haven't hurt myself yet. :-) I'm also thankful this season for the rest of my family having caught colds nasty enough to keep us home that aren't so bad as to make life at home miserable. Why? Some much-needed rest and relaxation. I've even had some time to catch up on some projects around the house in addition to spending time with my family, whipping up Thanksgiving dinner, and working hard on my future first choice of development tools, the real reason for this post.

I'm happy to say that Paladin has reached alpha -- it's now feature-complete. While I know of a few bugs that I found shortly before I stopped for the day, I bet there are more yet to be discovered and fixed before I'm comfy with releasing the official Beta 1. I'll be eating my own cat food (dog food? No thanks...) on this one, so it may be a bit, knowing my perfectionist tendencies. It should be well worth all the trouble, and the closer it gets to actual usefulness as a tool, the more excited I get. I'll be able to get rid of BeIDE's annoyances, and the community at large will have a free-as-in-freedom development environment. Who knows? Maybe the guys back at Haiku might even find it worthwhile to have as one of those tools included in the pre-alpha builds. I won't push for it or anything, but that'd be the icing on the cake.

Saturday, November 15, 2008

Paladin: Code by Day and by Knight

Wow. I can hardly believe that it's been more than a month since I posted about working with Oliver and Tako on Niue. A *lot* has happened since then besides my R2 proposal. My small diversion turned into a not-so-small one. It's funny how that seems to happen, but it grew in a good way. I'll get back to the DeskPanel sooner or later -- I'm having *way* too much fun right now.

The more I worked on the Niue sources in an attempt to clean them up, the more I felt like it was spaghetti code which would be easier to rewrite from scratch than to clean up. One night I just decided to see what it would take to put together a rudimentary project manager and it all snowballed from there. The result? An MIT-licensed IDE called Paladin which is modelled after the illustrious BeIDE which is based on Metrowerks' CodeWarrior. Xcode it ain't, but should be a pretty good improvement upon BeIDE.

BeIDE is an excellent, if dated, IDE which lends itself pretty well to beginners picking it up. Just so you know, BeIDE has been my right-hand coding tool since Day 1 when I started tinkering with the sources for an open-source paint program called Photon that I sort-of developed into BePhotoMagic. With the hundreds of hours I've logged using it, I've learned a few of its quirks. I've also found myself wanting certain features that, obviously, weren't going to materialize. I now have that chance to fix that.

The only IDE that we have for C/C++ development which even comes close to BeIDE is Niue. Niue's got some great features, like code completion and the ability to see the actual compilation output as if you were watching it in a Terminal window. So far, the only major problems I've seen outside of the maintainability department are that it depends on make to do all the heavy lifting, it eats up screen space like candy, there are bugs in the editor, and the code is a mess. Keep in mind, though, that the last two are probably the result of having lived and breathed BeIDE for years.

The project manager has gone together quickly, but I wanted to be able to hit Alt+M to build the thing while I still had focus on the editor. I also had some other integration-related desires that I'd need to have a text editor for. As a result, I started looking for information about writing one or building upon existing code. In my search, I learned about (and am reading) the book Design Patterns: Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnson, and Vlissides. I also discovered that Niue's editor is, in fact, a quite-modified version of Yate and why: writing a text editor is hard and time-consuming. Yate's sources, by the way, are part of the reason for the mess of Niue's sources, because Yate's code is bad. Really bad. There aren't very many other open-source text editors for BeOS. I narrowed things down to a port of Scintilla or hacking Pe. After spending a weekend off and on playing with Scintilla, I decided to go with Pe. The only thing about Pe is that it uses a different resource compiler, rez, which supports other text-based resources, such as dialog boxes and menus.

The only bad news that I have is that the result of these antics isn't even in an alpha state yet, but it is quite a promising IDE nonetheless. Currently I can build quite a few different kinds of projects, including Paladin itself. Pe is being pared down into a leaner text editor primarily focused on C++ development, so, for example, the HTML palette has been given the heave-ho. This doesn't mean you can't use it for other things -- the syntax highlighting for other languages is staying -- it just means it would be a little like using BeIDE for writing Python or Perl.

Paladin has a lot of potential because of both the features it has and the ones that are coming. Project files are just special text files, so they are both user-readable and friendly with CVS, git, SVN, and so on. Paladin can also be executed from the command line to build a project without a GUI, so it can be scripted. While no visual editor is planned, a boilerplate code generator feature is in the works -- choose what class to add to the project, give it a name, check off options and virtual methods you want implemented, and voila! Instant skeleton code, both header and source file. I'll probably be adding a feature to generate makefiles and jamfiles from projects. Projects can be run in the debugger, run from the Terminal, or (eventually) run with predetermined command-line arguments. Adding libraries from the standard locations to a project is literally a matter of clicking on a menu item and checking (or unchecking) items in a list. There is also some basic project template code which will probably be expanded, as well. Best of all, the thing is MIT-licensed, so once it's released, anyone can contribute to its development or utilize its code in other projects. I'm also contemplating a code library feature for those bits of code that we codemonkeys seem to be reusing time and again.

I'm excited about the whole thing and I hope this gives you a little more to look forward to for Haiku's future. Obligatory screenshot:



There's a new code warrior on the block. Have a good weekend everyone. :)

Thursday, November 6, 2008

R2 Desktop Revisions: It's *Finally* Published

After lots of research, tweaking, and refining, I've finally finished my proposal for the Haiku R2 desktop in its consolidated, revised form. It's about time, if you asked me. I originally planned to release it after the DeskPanel was finished, but with me working on something else that will see the light of day sometime soon as a nice diversion, it was better to get this out the door. There isn't a link on my old site, but it's kept there. You can get the PDF of the proposal here. If you care at all about the direction Haiku is going, please do me a favor and comment here or my blog thread on the subject over on the Haiku website.