Lightweight Pascal IDE

Lightweight Pascal IDE

by Ingemar Ragnemalm

Lightweight IDE (LWP) is a simple IDE for Mac OS X for Pascal/Object Pascal/C/C++ that provides a multi-window editor with syntax coloring, function pop-up and error shortcuts. It serves as a front-end to Free Pascal as well as GCC. This page is a Pascal Central mirror of Ingemar's LWP page which can be found at http://www.ragnemalm.se/lightweight/. To ensure you are getting the most up-to-date information, visit his website; or better yet, send email to the MacPascal mailing list.

There is also a
SourceForge web site set up to support the Open Source nature of Lightweight IDE. This is a great place to make contributions to the source code, as well as submit bug reports and feature requests!

This page was last updated on 7/15/07.

Why do we need another IDE?

Some people say they like Xcode. Well, I do not. It is a carelessly made design, very confusing and badly planned, which tries to do everything, and the result is that it doesn't do it well. There are symbols and options everywhere to the extent that you never find what you need. In particular, making an external compiler (like a Pascal compiler) work with it is a nightmare. Several people have worked on the problem, and although they manage to build scripts that can build applications, the system remains brittle and often fails.

I conclude that another path would be valuable, if nothing else for getting a simpler, more focused and less confusing solution.

Availability

Both the application and source code can be found on the SourceForge website.

What is Lightweight Pascal IDE?

Lightweight IDE (formerly Lightweight Pascal IDE, LWP for short) is a pretty simple application with the following major functions:


That is, it does everything important that Xcode does, except one thing: It includes no debugger front-end yet.

This is how it looks when running (older version):

There are two special windows, the message window (top-left) and the error message window (bottom-left). To the right is a text editor window. As you can see, there is syntax coloring, although it is incomplete and to be considered experimental so far.


Find and replace is implemented and works pretty well.


And there is a window menu for all open windows.

No project file

One thing is very special with LWP: There is no project file! There are two reasons for this:

You may argue that the two message windows above are more than you really need, and I agree. In the long run, I hope to make the message window (the plain text one) optional, but right now we can't do without it.

Application bundles

When you compile an application, LWP automatically creates a bundle, with the most necessary files, moves the executabe there, and also copies resource, nib and icns files present in the same folder as the main program file, if they share the same name.

No deep hierarchies

Did you ever notice that Xcode creates hilarious hierarchies of folders? You can navigate for some time just to find the application that you just compiled. LWP keeps everything nearby. The .o and .ppu files go into a sub-folder, but apart from that everything is under your fingertips, just where it should be.

Reasonably small

At 1.4 Mb, it is a small application by modern standards. But it is still twice as big as Think Pascal, which includes compiler and debugger. But Xcode is 48 Mb, and that is just a front-end too. The small size means that it is fast in many ways, startup in particular.

Compiling and linking with C units

LWP can compile C (using gcc) units that can be linked with Pascal programs. (It can not yet compile and build C applications.) If you open a C file and build, it creates a .o file (not in the intermediate-files folder but in the same folder as the source). If your Pascal program includes a LinkLib preprocessor statement (i.e. {$LinkLib 'MyCLib.o'} then it will try linking with it. Look in examples. It should also be noted that LWP not yet parses error messages when compiling C.

What is missing?

No, it isn't the world's best IDE yet. A couple of things are missing:

Well, and a million other gripes and wishes, but of less importance, and of course other languages.

Other languages?

LWP only supports Pascal at this time, but I very seriously plan to include options that make it possible to work with other languages in some way. My primary personal needs include these two cases:

So this will become possible. C is tricker, it is a more primitive language with no real support for modular programs. There is no guarantee that an "include" pre-processor clause has any relevance for code modules. But, with some strict rules for how the C parts shoud look (like demanding a 1-1 match of .c and .h), it will work.

Through shellscripts, LWP can really do anything (code for executing shell scripts is already in LWP but poorly tested and not satisfactory), but that is a primitive solution that allows little intelligent use of the results.



Copyright © 2006-2007, Ingemar Ragnemalm