- What is TOM?
TOM is an object-oriented programming language. At the same time, TOM
is an implementation of that language, as available from http://gerbil.org/tom/.
TOM allows the developer of the library to focus on the design instead
of the features, since any missing features can be added by the library's
users when needed. The user of a library will not be needlessly
overwhelmed by a huge number of features. Instead, he will be able to
concentrate on understanding the library's design, so he can use it well.
To name a few features:
- TOM sports extensibility of objects: a class is not just
defined by its main definition: classes can be adjusted, even at run
time. A prime example of this is to modify in your program a class
offered by a shared library, just to make it suit your program better.
- TOM methods employ default argument values and multi-valued returns;
- TOM has multiple inheritance - with semantics much simpler than in C++
or Eiffel and obviating the need for interfaces (Java) or protocols
(Objective-C);
- TOM offers reflectivity on objects, their classes, member variables,
and methods;
- TOM discerns classes and a few basic types - like Java and
Objective-C;
- TOM has conditions modeled after CLOS conditions;
- TOM, as compiled by Tesla, the first TOM compiler written in TOM, adds
blocks to the language;
- The TOM standard libraries offers time-constrained garbage collection,
multi-threading, distributed objects.
- What does the name mean?
The name TOM is a name. Names don't need to have a meaning. :)
- What does TOM code look like?
Like this implementation of hello, world:
int
main Array arguments
{
[[[stdio out] print "hello, world"] nl];
}
or this little program to print the first 10 squares:
int
main Array arguments
{
int i;
for (i = 1; i <= 10; i++)
[[[stdio out] print (i, " * ", i, " = ", i * i)] nl];
}
- How does TOM compare to Java, C++, or
<your favourite language>?
Syntactically, TOM resembles Objective-C. Semantically, it deviates
from Objective-C in a way similar to Java. TOM code is compiled to
object code that is linked to the TOM standard libraries. TOM does not
depend on a virtual machine.
- How fast is TOM?
TOM the language does not impose or imply any speed limits.
TOM the implementation is similar in speed to the Objective-C
implementation provided by GNU CC: all method invocations are dynamically
bound and no inter-procedural optimizations are performed.
- Can TOM interface with other languages?
A TOM method can be declared extern and subsequently
implemented in C. Furthermore, with the currently available TOM
compilers, which both compile TOM to C, TOM code may contain C code. It
is like an
asm ("ld r2, foo; st zero, [r2]");
in C, written as
<c> foo = 0; </c>
in TOM.
- Is TOM code embeddable into other
programs?
It is very easy to write TOM code to be dynamically loaded. In
addition, all that a program needs to do to be able to dynamically load
TOM code is link with the TOM standard libraries. As a proof of concept,
the Apache TOM Module enables Apache to be extended in TOM.
- Can TOM connect with database systems?
The TOM DataBase Connectivity (TDBC) package provides a popular tabular database
abstraction, as it is known from, for instance, Python and Java. Currently, PostgreSQL and MySQL is served, and adding
support for additional databases should not prove difficult.
- Can TOM speak CORBA?
An implementation of COBRA for TOM does not exist yet. However, given
the refelective capabilities of TOM, a CORBA implementation for TOM would
not be too difficult to implement.
- Where can I find the TOM FAQ?
At http://gerbil.org/tom/faq.
- Under what license is TOM available?
TOM is Open Source and Free Software: The TOM compilers and other tools
are licensed under the GNU General
Public License (GPL); the libraries under the
GNU Library General Public License (LGPL).
This means that (1) you can apply TOM for commercial applications---no
strings attached---and (2) if you fix a bug in the TOM tools or libraries
the rest of the world should share in that achievement.
If you want a different license, or if you want to pay for commercial
support, mail tiggr at gerbil.org.
- How do I debug an executable built by running make?
The result of running make is normally not the executable proper, but a
script that is created by libtool. That script does the shared-library
magic needed to run the executable in-place. To actually debug the
executable in-place, you need additional magic:
libtool --mode=execute gdb ./yourapp
|