Copyright ã 1994 by Sean Luke

COWS
Introduction
COWS Version 1.4
Sean Luke
May 29, 1994

COWS is a simple macro language for NeXTSTEP.  It is designed to give you, the user, much more power over an application than you have now.  With COWS you can:

¨	Control a COWS-compliant application within the application itself through a simple but powerful macro language.
¨	Control any COWS-compliant application from another COWS-compliant application, even on another machine, using the same macro language.  This way, you can stitch many applications together to do custom work for you automatically.
¨	Extend the power of a COWS-compliant application by adding COWS function libraries in the macro language or compiled Objective-C.
¨	Manipulate any non-COWS-compliant NeXTSTEP application by recording keystrokes and mouse movements, storing these away as COWS functions.
¨	Build and test simple NeXTSTEP applications in Interface Builder without using any Objective C at all.

This COWS interpreter package is freely available, though marketing parts of this package as objectware should only be done with the permission of the author.  But you are free to make and sell your own interpreter, so long as it is compliant with COWS protocols.  We need to develop a community here!

What Comes with COWS

COWS basically consists of seven items:

¨	The COWS Interpreter, an Objective-C object (and a few associated objects) that can be dropped into any application and hooked up with small effort.
¨	The current COWS language specification.
¨	A series of protocols describing how COWS and other interpreters communicate with each other, with the application, and with function libraries.  This allows more sophisticated (i.e., faster) interpreters, or interpreters with prettier language syntax, to be dropped into an application replacing the COWS interpreterÐthe application won't know the difference.
¨	Objective-C COWS function libraries to extend the power of the COWS macro language.  These currently include a standard library, an array library, an inter-process control library, and a demonstration library to show COWS abilities.
¨	Palettes of the COWS interpreter, libraries, and supporting objects intended to integrate COWS into Interface Builder.
¨	Example Interface Builder files.

Requirements

COWS requires NeXTSTEP 3.1 or greater, preferably NeXTSTEP 3.2.  Though users can do some interesting things with COWS, this version is intended mostly for developers and as such really needs the NeXTSTEP Developer kit to do any real work.

Setting up COWS

In this directory, the accompanying file, Setup, explains (vaguely) how to get COWS up and running on your system.  In general, you need to have specific apps and palettes compiled and placed in the right places, and certain directories created.  It's not a major task, though, and it won't make any modifications to your existing system.

Where Can I Get COWS?

Currently, COWS resides in /pub/next/nextinterpreter on ftp.et.byu.edu, the same site as the MiscKit.  In addition to the source and documentation, compiled versions of the programs and palettes are also available here.

There are also COWS e-mail lists.  If you'd like to join, send mail to sean@zapotec.math.byu.edu.

What's Left to Do

There are projects or plans currently underway to make:

¨	A better, faster, smaller, more robust interpreter
¨	OOP COWS
¨	A compiler that converts COWS programs into COWS-compliant Objective-C function libraries (some hacking on the interpreter to make it reentrant will be necessary as well)

In addition, the following areas could benefit COWS greatly

¨	Disk i/o, and better system-call libraries
¨	An alternative language syntax (currently, COWS is LISP-like, but that doesn't have to be its final form).  TCL would be a nice choice.  Perl too.  Scheme?
¨	Possibly a client-server interpreter design, though I suspect this may be slower than is acceptable.

How Can I Help?

Please join the fray!  COWS needs all the help it can get.  There are plenty of function libraries and apps to go around for everyone to work on, and we need test applications, interpreter/language experts, and beta users. You don't have to be a master of COWS to contribute to the programming, though having a good understanding of NeXTSTEP and Obj-C would help.  If you have neither, you can still help out in testing the applications, contributing ideas (we programmers always see things with an, um, programmer-point-of-view), and helping evangelize to developers in the marketplace about the need for a macro language design, even if it isn't COWS.

If you're interested in helping out in particular parts of the COWS project, send mail to sean@zapotec.math.byu.edu.  

Thanks to...

¨	Michal Jaegermann for new COWS String Nodes, much of the COWS Math Library, and work on a more efficient interpreter.
¨	Guus Bloemsma for help on the COWS Math Library and other assorted topics.
¨	Don Yacktman for a considerable amount of help in developing the system, an ftp site, and mail list administration.
¨	Glen Henshaw for the COWS name.
¨	Benjamin Black for the directory icon.
¨	Todd Nathan for the app icon and testing.
¨	Paul Cardon for testing, support, and ideas.
¨	Kris Magnusson and Alpine Computing MicroAge for an ftp site and mail list.  
¨	Dave Griffiths for Puppeteer.app, help on Distributed Objects, messaging, etc.
¨	Brett Adam for the OpenScript discussion list.

Caveats

The copyright junk...  

You'll probably notice that the docs and code is copyrighted.  This is not intended to prevent you from using it in your applicationsÐit's free to use in this way.  It is intended to prevent you from selling or otherwise distributing raw COWS code for profit without permission of the authors.  Most code and documentation is copyrighted by Sean Luke, but a growing body is copyrighted by other authors.  By COWS 1.5 we should have settled on a uniform license agreement, probably similar to the MiscKit.

About the name...  

COWS is an Acronym With No Meaningä.  The language name came from Glen Henshaw making fun of Sean Luke's old much-abused signature quote ("Milk:  It Comes From Cows"), and overwhelmingly chosen a few months back.

COWS is big!

Yes.  It's a problem.  COWS is intended to be small, and the interpreter and a minimal library setup takes up only 40K or so.  But additional libraries add greatly to the size of the binary not because the code is large but because each library links in a healthy dose of NeXTSTEP junk.  The IPC and System libraries are major culprits.

If you're not using the full collection of libraries, or aren't using one of the two controllers or the COWS Control Panel, try removing unused items from the COWS project.  This will shrink your app size down by quite a bit!

By 1.5, COWS may have dynamic loading of libraries, which will alleviate much of this problem.  Of course, this will cause yet another problem:  dynamic loading is slow at launch-time.  Another option is to break libraries and controllers into seperate subprojects, though we're loathe to create a system with 20 subprojects.

Will COWS be faster soon?

Yes.  Right now, COWS is still using its experimental first interpreter.  There is a project underway to rewrite the interpeter in its entirety.  There is one fundamental thing, however, which will prevent COWS from being as fast as other languages:  it's written in Objective-C.  Objective-C method calls are up to 4 times slower than C function calls.  Objective-C object allocation is also slow.  COWS allocates and deallocates objects all the time.  But have no fear, we should have a much faster one out soon.

Why not TCL?

Why not indeed?  TCL is a fine language.  But the intent of COWS was (and is) to provide a macro interpreter design for NeXTSTEP.  The TCL interpreter doesn't quite fit into this mold, in my opinion.  

This doesn't prevent TCL from being substituted as the COWS interpreter, howeverÐin fact, it should be fairly easy to do (if you'd like to volunteer your help, we'd be appreciative).  The COWS protocol suite is very general and intended for exactly this possibility.  And the COWS language syntax may change radically without any problems.  TCL could be easily adapted to match the COWS interpreter interface

But most important, COWS is a dynamic languageÐit's in rapid flux.  By the time 1.5 or 1.6 comes out, COWS may be a full-fledged OOP language instead of the procedural one it is now.   As of this release there were many changes to the language, and significant changes to the COWSStringNode, the central data type inside the interpreter.  TCL cannot provide this changability for us, as its interpreter is fixed in form and its syntax and semantics are out of our control.