|
|
Talking SHEEP
The famous author of th AmigaE language Wouter van Oortmerssen has created a new piece of computational art, which may serve the Amiga Digital Environment as an innovative script language.
Wouter now works for Amiga Inc. as his regular occupation. The project's name code is SHEEP (which is, as he told me, NOT an acronym :-) SHEEP will be a new form of programmer's state of expressions with multi-purpose capabilities. It is designed to be far more powerful than it's predecessor ARexx. In the near future SHEEP will become the glue to hold the basis for the AmiVerse.
Similar to ARexx SHEEP is at first glance quite a normal language for interpreters, which also can be used for interprocess-communication. Furthermore, it can be used for databank-queries (in SQL-stile) and flexible creation and change of GUIs (graphical user interfaces).
Where are the differences to ARexx now?
At first SHEEP looks like a standard imperative code languaga as ANSI C, Modula-2, (V-)Basic or E. In core it is driven by a functional approach, though. Amiga World number four presents the following simple example:
type tree = branch(left:tree, right:tree) | leaf(data)
This creates a simple data structure "tree", whose branches can also be of tree-type (recursive), or be leaves. These leaves may contain constant or variable data or records of data. This way it is possible (and quite easy) to generate your own data types freely, build up super-types and comply with all questioned purposes perfectly.
So SHEEP is a perfect language to do rapid prototyping. Using the interpreter the programs can be executed on the machine very fast. Human can use the compiler to translate the sheepies into fast code for the (virtual) processor. As always in the field of computation, speed matters: The sheepies run faster than ther pendants in Java, ARexx or Basic. The average speed lies in magnitude of C/C++.
The turning towards an object oriented approach of programming is clearly evident within SHEEP and matches the modular organization of the AmigaDE. Memory management is taking place without the traditional garbage collection for dynamic objects, as found in many other languages. Au contraire, there is a protection mechanism for preventing memory contents with important data of being overwritten by mistake. So SHEEP also becomes a good language for beginners on the field of programming.
Most impressing i found the example of Quicksort in SHEEP. Here it becomes a (rather complex, though) code of just four lines. There is no consideration of the type of data being sorted. This is not due to sloppyness, but fully intentional: So the same piece of code can sort integers, pieces of text or any information, that comes along and is countable ordinarily, (i.e. not "complex").
Also new is the concept of vectors for data storage:
Data normally stored in static arrays or within dynamic lists is enclosed in these vectors. They can be manipulated using simple operations. The following example may show the idea with "a" being such a vector:
a = [1,2,3] a = a+[4,5,6]
results in [1,2,3,4,5,6] for a. In a very similar way the "+"-operator can be used to split vectors into their parts. Modularization and integrated error and exception routines make SHEEP "round" in a way, that is most presentable.
Without discussing the other examples in this place, one can say that SHEEP really is friendly to beginners and places a very modern alternative compared to E. It incooperates lots of single good features from languages like ARexx, Prolog, BASIC, Perl, Java and Python. Advanced programmers will find possibillities of expressing their ideas within SHEEP, that are capable of the realization of projects at least of mid-size magnitude in a very reasonable manner.
Because of it's simplicity an enormous potential i have asked Wouter about potential risks placed by Virii, Trojans, etc. that could come from using SHEEP. Similar to Javascript code, which should normally not be able to erase code on the harddisk, there will be a protection mechanism between the information contained within emails or web-pages and lower planes.
The rest of issues in this area is left to programmers of mailing clients and personal responsibility (or stupidity :-) of users.
By now SHEEP is in private beta stage. So there is no third-party report, which could be integrated into this presentation. The success of AmigaE within the community gives raise to the hope, that more users and developers will get to like the Amiga system.
Link:
http://www.amiga.com/press/zine/11-1-00/sheep
Stefan Czinczoll <sczinczoll@max.uni-duisburg.de>