Ewe Under the Hood

 

Like Java, Ewe consists of two components: the VM itself and the class library. The Ewe VM itself is a limited Java VM. It supports all Java syntax EXCEPT:

  1. It does not provide true pre-emptive thread functionality. The synchronized keyword has no effect and no Thread class is provided. A Coroutine class is included which provides co-operative multi-tasking via explicit sleep() calls which allow other Coroutines to run.
  2. There is no security model.

 

The Ewe class library is not a standard Java library. It is a very extensive library with utility, graphics and UI classes, but is very different from the standard Java library. The only classes it shares with standard Java are a few classes and exceptions in the java.lang package.

Ewe and Waba

Ewe is an extension of the Waba VM written by Rick Wild, available at http://www.wabasoft.com/. However the extensions and changes made to the VM and the class library make the two systems now largely incompatible. While Waba (and its various ports and extensions, include SuperWaba) is still suitable for very small devices with very limited OS functionality and memory resources, Ewe will only work effectively on systems that provide a true 32-bit OS.

Native Ewe VMs

The Ewe VM is written exclusively in C and is generally very portable. A port of Ewe to a new OS will probably require less than three months. This is because most of it is contained in the machine independent Java class library; the VM itself is very small.

 

However there are certain requirements for Ewe to be ported to a new OS. Specifically Ewe requires that the OS:

 

  1. Be a 32-bit system. That is, an int type integer value should be 32 bits.
  2. Be able to allocate arbitrarily large blocks of memory, even above 1MB. That is to say, the only limit on memory size imposed by a malloc() (Ewe is written exclusively in C) is the actual amount of memory available in the system.
  3. Be able to store arbitrarily sized blocks of data in its permanent file system (or whatever system it uses for this purpose).
  4. Provide at least a single drawing surface with simple “clippable” drawing contexts (i.e. some kind of Graphics like object).
  5. Provide mouse or pen or keyboard input.
  6. Have some kind real-time or timer capability.
  7. Run on a 32-bit processor of with the power of a MIPS running at around 100MHz. (This only affects the speed of the running application).

 

Ewe can optionally take advantage of:

 

  1. Multiple window support (for better GUI functionality).
  2. True-multi threaded support (for better real-time and I/O performance).

 

Unfortunately, many mobile operating systems do not provide all the minimum requirements as laid out in points 1 to 6. For example, Palm OS places tight restrictions on the allocation of memory to applications and on the size of individual blocks of stored data. Without these restrictions, Ewe would certainly work with little problem on Palm systems.  The RIM blackberry also places restrictions which make porting Ewe very difficult on such systems.

 

However, in the case of the Palm OS it is clear that Palm is in the process of revamping both the hardware and the OS that runs on its devices. They have announced that they will be switching to the StrongARM processor (a much more powerful one than the current Dragonball) and they have also acquired Be systems (the maker of the very good, but poorly marketed 32-bit OS). I have no doubt that 2002 will see the unveiling of a new Palm platform which will be more than capable of running Ewe.

Java Ewe VMs

Ewe applications do not require a native Ewe VM in order to run. The purpose of the Ewe VM is two-fold:

  1. It provides a simple single-threaded limited Java VM to execute Ewe programs.
  2. It implements all the native methods in the Ewe VM class library which are used to access system level functionality.

 

Both of these requirements can also be met by a true Java VM. There are separate selected classes that replace the native VM targeted classes and that allow the class library to run on a Java 1.1 or 1.2 compliant Java VM. These classes effectively make up the Java Ewe VM. This means that any Ewe application can run on a system with a true Java VM (1.1 or better) installed. The Jewel program builder (included in the free development environment for Ewe) allows you to package your application as a Jar file (which includes the pure Java version of the Ewe class library) and this allows it to be run on any Java enabled system.

Ewe programs as Applets

Because Ewe programs can run under any Java VM they can also be run as Applets within a Java enabled web browser. Once the browser is 1.1 or 1.2 compliant, the Ewe program will work with no modifications. Again, the Jewel program builder is able to package your Ewe program appropriately so that it may be run as an applet with little or no modification.