Gnu-Win32: Unix Tools for Windows

Now and then, something happens that makes your day. Gnu-Win32 did it for me a while ago. While I'm not a programmer by trade, I do dabble from time to time, and I prefer to do it under Unix because it makes more sense to me than Windows ever did. But sometimes, you're stuck with one of the ubiquitous Windows machines, for one reason or another, and you must work with what you have. Now, with Gnu-Win32, you can use those powerful Unix tools in a Windows 95 or NT environment.

Why Unix?

To people who aren't familiar with Unix, the question has to be answered: it's a rich programming and operating environment. But isn't Unix harder than Windows? No, not really; it's just very different. It also takes longer to learn to use, but once learned, it's far easier to use than Windows.

I say developing for Unix minimizes your work and your risk because your code becomes more transportable for different architectures than just Windows. You don't have to depend simply on one market, albeit the largest personal computer opsys market. Your code can be adapted more easily to other applications, such as network workstations or even a niche market you didn't even know existed. It minimizes your work because you aren't tied to Microsoft-specific conventions which only work under Windows. Your software can run on the re-emerging and blossoming new Unix platforms in addition to the Windows platforms you're familiar with.

Whether you may legally call Microsoft a monopoly is beside the point. Microsoft looks like a monopoly, talks like a monopoly, and acts like a monopoly. It's only natural that they will act first to preserve their monopoly power whether it best serves the customer or not. When it comes to developers, it's in Microsoft's best interest to encourage exclusive commitment to their own Windows architecture, not cross platform development that enhances their competitors' attractiveness. By using Gnu-Win32, you can make your applications run on both and have the best of both worlds.

But What if I'm Not a Programmer?

Fine. GNU-Win32 means that you can now use a wealth of free and rock-solid Unix programs on your Windows machines. Numerous longtime favorite Unix utilities, such as the Bourne again shell (bash) or the GNU C Compiler (GCC), can run thanks to the Cygwin32 library (cygwin.dll) that provides the calls and environment this software expects. Since these free GNU utilities include the source code, you can compile them for custom use in your own environment. You can take advantage of all the innovation to these tools occuring in the exploding free software movement.

Even though you may not know a fork() from a spoon, you can still learn to use the powerful bash shell for example. Your typical Windows machine comes with a command interpreter called command.com, which pales in comparison to bash. With command.com, you're pretty much limited to measely batch files. With bash, you can run shell scripts that truly dazzel the eye and, more importantly, do hundreds of your chores that command.com couldn't dream of doing for you. Even if you're not a programmer or a shell script writer, you can still use many of the bazillions of scripts freely available and shared on the Internet among Unix geezers.

Yeah, But Does it Really Work?

GNU-Win32 is a beta release 19.1 from Cygnus Software under the GNU Public License. (See http://www.cygnus.com/gnu-win32/ for more info.) Still, it is surprisingly stable and robust. There are numerous hiccups and gotchas, however. You should read the FAQ and follow all instructions carefully, especially if you're new to Unix. The APIs between the two are vastly different, and what appears to be a simple and unimportant difference can wind up biting you big time.

The basic idea is that the Cygwin32 library mentioned above provides a Unix API (Application Programmers Interface) in a Windows environment. The Unix utilities in question are compiled from source against this library, and poof! They run on Windows! The Cygwin library provides all the Unix stuff necessary for them to run on Windows. And, if you're a programmer or have Unix programmers working for you, they are no longer forced to choose to develop exclusively for Unix or Windows by a complicated porting process. Porting their Unix apps to Windows is greatly simplified.

Some weaknesses still exist, naturally. Cygwin32 is not secure in a multi-user environment. The library is not multi-thread safe. Symlinks don't work on networked drives. Network related functions have some trouble due to differences between Unix and Windows sockets, although this is improving.

So What Sort of Unix Stuff Can I Use?

So far, some pretty impressive Unix packages can compile and run under GNU-Win32, including ghostview, groff, ncurses, rcs, termcap, uucp, xfig, vim, tcsh, X11R6, Joe, Lynx, Mutt, Perl, Texinfo, bibtex, xdvi, autoconf and automake, and others. The standard GNU-Win toolkit itself includes many powerful tools.

Conclusion

Even if you aren't a big programmer, you can still use many of the best applications for both Unix and Windows under the same platform thanks to GNU-Win32. Since it's an open-source project, it is growing quite rapidly and has matured as good open-source projects tend to do. You can visit the homepage (http://www.cygnus.com/gnu-win32/) for more research. If nothing else, you can add tremendous functionality to your Windows 95 or NT system by using the Bourne again shell!



David S. Jackson
Sat Nov 28 17:06:08 EST 1998