Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Eiffel-like languages

11 views
Skip to first unread message

Roger Browne

unread,
Aug 11, 1998, 3:00:00 AM8/11/98
to
Eiffel has spawned several Eiffel-like languages, including Sather
and Blue. Another Eiffel-like language was sold for a while by
Apple Computer as part of their multimedia toolkit.

I started to write an article about this language for Eiffel Outlook,
but didn't finish it. Here, for the interest of comp.lang.eiffel
readers, is the partially-finished article.

I hope you find it interesting.

Regards,
Roger


==========


EIFFEL-LIKE LANGUAGES


AML: Eiffel without realizing it!
---------------------------------
by Roger Browne
<ro...@eiffel.tm>
11 August 1998

The most commercially-successful of the Eiffel-like languages is in
widespread use by Apple Macintosh developers - but most of them are
blissfully unaware of its Eiffel connection.

Apple’s AMT/PE is a pair of companion products - the Apple Media Tool
(AMT) and the Eiffel-inspired Programming Environment (PE).

The Apple Media Tool is a visual object-oriented multimedia authoring
tool. It allows users to quickly and easily assemble media elements
(graphics, video, text and sound) and then add interactivity and
navigation without the need to use scripting.


The Eiffel Connection
---------------------

Behind the scenes, AMT generates a program in Apple Media Language
(AML), an Eiffel-like language. The generated AML program can be
modified or extended, or an application can be written from scratch
in AML. The AML code can then be compiled for the Macintosh or for
Windows (using C as an intermediate language).

Eiffel users will not be surprised to hear that Apple has described
the underlying language - AML - as "efficient and easy-to-read, yet
easy to maintain and modify", and says that "programmers can extend
the AMT/PE class library to build reusable libraries; once objects
are written they can be used in later projects."

The Programming Environment includes a cut-down version of the
Macintosh Programmer’s Workbench, and a debugger, making it possible
to set breakpoints, step through code and examine the state of
objects in a running application.

The Programming environment also allows external routines to be
coded in C, thereby providing access to the Macintosh and Windows
toolboxes.

The Apple Media Tool itself is mostly written in AML, and source
code is supplied. A number of users have written and distributed
enhancements for it, and for its runtime engine.


The AML Language
----------------

A project is comprised of classes. A class defines a type by
inheritance from its parent classes, and by features introduced
in the class. Class features are fields and methods.

Objects are intances of a class. They take up memory, and may contain
other objects.

Fields are variables available to an object, and are initialized to
'void' when the object is created. ":=" is used for assignment.

Methods are functions or procedures available to instances of a class.

Garbage Collection is automatic. Any object not currently referenced
may be dynamically purged from the heap.

Statements end with a semicolon. Anything after two hyphens ('--')
is a comment.

Predefined types are ANY, INTEGER, STRING, CHARACTER and BOOLEAN.
Important predefined constants are true, false and void.

Standard unary and binary math operators are available.
The result of a function is returned in a special field called
'result', which is set to void on entry to the function.

You can include "C" external code.


Differences from Eiffel
-----------------------

AML grew out of Eiffel 2.x, so it differs from modern Eiffel. Also,
some changes have been made to suit the taste of the language
designers - such as the use of 'self' instead of 'current'.

Also, AML has been modified extensively to suit the needs of
multimedia programming, where it is frequently the case that there
will be only one object of each type, or that each object will differ
only by the addition of a method or two.

In AML, methods in addition to those defined by the class may be
specified by an object when declared. All that is needed is to use
the keyword "object" instead of "class".

Only an object may initialize its fields. This is done with the 'with'
statement - creation procedures are not used.

The declaration of a class or object implicitly creates a TYPE
object of the same name. These TYPE objects are used at runtime for
type checking. The 'is?' operator can be used to test a varaible's type, for
example:

if arg is? STRING then ... end if;

The integer division operator is "%".


Idioms
------

The "=" operator tests for reference equality. As in Eiffel 2.x, the
only expanded types are basic types (INTEGER, CHARACTER and
BOOLEAN). There is no 'deep_equal' operation, but two strings can be
tested for value equality with the rather unintuitive expression
"(s - s2) = 0".

'[' marks the start of an array and ']' marks the end of an array and commas
',' are used to separate items in an array, for example:

Items is [ "Picture", "Sound", "Movie", "Text" ];

'#' is used to get the index of an item in an array. For example...

count := #"test";

..would assign the value of 4 to count.

'@' is used to access an element in an array, and a STRING behaves
like an ARRAY of CHARACTERs. For example...

c := "test" @ 2;

..would assign to 'c' the CHARACTER 'e';


Examples
--------

The first example demonstrates the "from" loop, which is similar
to Eiffel's "from" loop except for the addition of an optional
"step" subclause:

from
BoundsCheck := false;
until BoundsCheck loop
DoSomething;
step
self.increment();
end

The second example illustrates many differences from Eiffel.
It shows the declaration of an object - a customised
instance of a class. The keyword "is" serves both for inheritance
and to declare initial values (which are not restricted to manifest
constants as they are in Eiffel).

The keyword "has" introduces new features, whilst "with" introduces
initialization of features already declared in the class (in this case,
in the class "cPictureHandler"):

object Blinker is cPictureHandler
with
Duration is 60; -- a constant attribute (60 ticks = 1 second)
Behavior is cDefaultBehavior -- a nested object definition
has
... -- new features for 'Behaviour' go here
with
Enabled is false;
Shown is true;
end;
end;


The History of Apple Media Tool
-------------------------------

The product that became AMT was developed by a team of three Belgian
engineers: Gilbert Amar, Sébastien Burel and Patrick Soquet. The
underlying language was known as "Language K", and to this day the
name lives on in the ".k" suffix of the source files.

Apple was looking for authoring tools, and licensed it. AMT/PE has
been available since September 1993, and over 100 commercial CD-ROM
titles have been developed with it, ranging from art history and
children’s entertainment to corporate training and rock music.

It gained second place in terms of market share, with first place
going to Macromedia’s Director, despite Director’s origins as an
animation tool rather than a multimedia authoring tool.

According to AMT user Marc van Olmen, Apple's long-term plan was to
replace the "Language K" component of AMT with a product called ScriptX.
ScriptX was to be the "be-all and end-all" of multimedia scripting
languages, and was being developed by Kaleida, a joint
Apple-IBM venture.

But as is so often the case, throwing hordes of developers at a project
doesn’t necessarily produce proportional results.

Apple eventually realized that ScriptX used too much memory, was too
slow, too buggy and generally over-engineered. ScriptX was dead. But
so, it seems, was Apple’s interest in AML.


Tough Decisions
---------------

In March 1997, Apple made some tough downsizing decisions, and
released a list of technologies that it was keeping, and a list of
those it was dropping. Those dropped included text-to-speech
products, the AIX server software, and AMT.

Andrew Salop, AMT Product Manager, commented, "AMT, despite its
brilliance, was not a comfortable fit in Apple's business model.
And many of us have the bruises to prove it. The recent announcement
was no surprise."

It had always been a difficult product for Apple. At first it had
been distributed through their developer channels - but multimedia
authors don’t think of themselves as developers.

Things improved once distribution was handed over to Claris - then
Apple released a Director plug-in for QuickDraw3D before making the
same functionality available to AMT. This is akin to Microsoft issuing
plug-ins for Netscape before Internet Explorer!

There were also tug-of-wars within Apple. Some thought that OpenDoc
could be something for AMT; others wanted to integrate Hypercard;
some wanted to drop AML in favor of QuickTime Interactive. There
seemed to be no clear strategy for the product.

Andrew Salop continued: "but this does not mean the product will die.
The facts are that this product works, is evolved, has a loyal
following, and given the right development environment and marketing
resources can become a major player in the interactive industry."

And it seems that he was right.


Back Home Again
---------------

AMT/PE is now as healthy as ever, both commercially and technically,
at the company that developed the first and second versions of AMT,
and originally licensed the product to Apple.

Encore Développement, a subsidiary of Havas Edition Electronique
(who are in turn a subsidiary of the global Havas communications
group) are continuing development. The development team is unchanged
(they never stopped working on the product), and they have recently
released upgrades to the AMT/PE engine and runtime.

It seems that this Eiffel-inspired language has a long and successful
future ahead of it.


References
----------

(Unofficial) AMT Home Page
http://macinfo.ccs.queensu.ca/Mark/AMT2/

Basics about AML
http://macinfo.ccs.queensu.ca/Mark/AMT2/UsingAMTsourceSidebar.html

Comparison of AMT and Director
http://macinfo.its.queensu.ca/Mark/AMT2/amtdir.html

Using AMT Source -- Yes AMT user, you can edit AMT source files!
"You don't have to be a programmer, but it helps if you know one."
http://macinfo.its.queensu.ca/Mark/AMT2/UsingAMTSource.html

AMT/PE FAQ
http://ccsmacinfo.ccs.queensu.ca/Mark/ AMT2/AMTfaq.html

AMT VR Tips (with some AML code examples)
http://macinfo.its.queensu.ca/Mark/AMT2/AMTVR.html

Apple Technical Q&A
http://developer.apple.com/qa/amt_pe/amt_pe05.html
http://devworld.euro.apple.com/qa/amt_pe/amt_pe24.html
http://devworld.euro.apple.com/qa/amt_pe/amt_pe25.html


In closing...
-------------

Here's a quote from Kate Adams of Apple, about AML (and, indirectly,
about Eiffel):

"You may find, as I did, that you can be a mediocre Hypertalk
programmer, a poor C programmer and completely incapable of even
thinking about programming your VCR but still be a darned good
cross-platform object-oriented programmer because you don't have
to worry about all the nit-picky stuff at the bottom"

And here's a quote from the "Lina" project, which writes and shares
AMT software. At http://www.lina.polytechnique.fr/About.shtml
they write that:

"AMT [software] ... is written mostly in a
peculiar language ... conceved after an
experimental language called Eiffel."

So there you have it! That's how it looks from the "other side of
the fence"!

==========


--
--
-- Roger Browne ro...@eiffel.tm - Everything Eiffel http://www.eiffel.tm
-- 6 Bambers Walk, Wesham PR4 3DG, UK - Phone & fax +44-1772-687525

Roger Browne

unread,
Aug 12, 1998, 3:00:00 AM8/12/98
to
Yesterday I wrote about AML:

> ...Behind the scenes, AMT generates a program in Apple Media Language
> (AML), an Eiffel-like language...

I have been told by Mark Fleming that a new multimedia development product for
the Macintosh called "Toto" is about to go into Beta.

It's also based around Apple Media Language (the *.k files and Eiffel-inspired
language used by Apple Media Tool).

Regards,
Roger

0 new messages