Actually, this new 2.0 release is the beginning of a new era in
SmartEiffel's life!
The architecture of the compiler has been completely revisited during this
long period of hard work (more than one year since previous release).
The most important goal of this new architecture is to
improve compilation time of very large systems and to take into account
repeated inheritance as well as the new non-conforming
inheritance mechanism.
For the latest point, please note that the SmartEiffel compiler is the very first one
to implement such Eiffel novelties.
Implementation of non-conforming inheritance is not a piece of cake and we
think we made a great job to experiment this new feature of the Eiffel language
(see after for details).
Also, and not the least, the new vision library, our graphical
Eiffel toolkit, is now part of the standard release.
The vision library makes intensive usage of the new agent mechanism and
allow you to write graphical applications in pure Eiffel.
The generated C code can run both on X windows and Windows api without any modification.
More details about changes from 1.1
- Very large systems are handled far more efficiently (but maybe at
a cost for smaller systems).
- The new non-conforming inheritance mechanism is now implemented.
For code portatbility, we decided to stick with the "inherit" keyword
for conforming parents. So just start your class as usual.
Then, to describe the non-conforming parents, just use the "insert" keyword
folowed by the list of non-conforming parents.
Just use the same syntax as in the inherit part.
Note that we have removed the "select" clause (you'll be warned by the compiler).
Also keep in mind that when a class has no "inherit" clause and
no "insert" clause, the default
insert ANY
is automatically
added.
Finally, the latest thing to know is that, at time beeing, only one conforming path (i.e.
an inherit
path) is allowed between two points of the inheritance graph.
- Repeated inheritance is now correctly handled.
- The optimizer is rewritten and can do more optimizations.
- Pretty style improved, all provided classes have been handled by
pretty. If you like the style as we does, you can apply pretty to your files.
You can set your favorite editor with as many spaces as you want for
TAB character (old look is 3 spaces).
- The new debugger as abilities to print attributes of an object.
You can use dotted notation such as x.y.storage.0 (numbers give access to
elements of NATIVE_ARRAYs). Command such as p ..1 is useful to get another
element of the array or another attribute of the same object.
- Dead code is now checked, which explains the compiler takes more
time and memory.
- The directory structure of the general purpose library has been
completely revisited. The old structure was, well, old, and did not scale
efficiently when we wanted to add more classes; and some classes were not
in the "good" cluster.
The new organization splits the classes by logical topics. Note that each
cluster may contain two special clusters: "low_level", containing classes
that you might use if you need better performance (generally when you build
some utility or library classes); "internal" containing support classes,
and not meant to be used directly.
Now, the organization itself:
- "abilities" contains the "able" classes (COMPARABLE, HASHABLE, and so on);
- "io" contains the input-out classes; this cluster has but changed
from the old one (see below for more details);
- "iterator" still contains the iterator on storage classes (see the
"storage" cluster);
- "kernel" contains the few general-purpose which could not be put in other
clusters, and are quite mandatory for the compiler to work;
- "numeric" contains all the classes that can be use to manipulate numbers;
you will find here INTEGERs, REALs, but also NUMBERs (the
infinite-precision integers); This cluster also includes the new MUTABLE_BIG_INTEGER
class which is an efficient tools for fast integer number crunching.
- "random" contains the pseudo-random number generation classes;
- "scoop" contains the SCOOP utilities (not that SCOOP works better than in
SE 1.1...);
- "storage" contains all the classes that store data: COLLECTION,
DICTIONARY, SET... (Note: see below for more details on DICTIONARY and
SET);
- "string" contains the STRING and related classes (also Unicode strings);
- "time" contains the TIME-related classes;
- "vision" contains the vision graphical library classes;
- "sorting" contains most common algorithm to sort COLLECTIONs;
- "misc" contains some useful classes that cannot be easily put elsewhere
short of having their own cluster.
- The DICTIONARY class is now deferred and the DICTIONARY class has
no more generic constraint. The library now includes two different
implementations for class DICTIONARY.
- The HASHED_DICTIONARY implementation is the hash_code based implementation
(the generic constraint for HASHED_DICTIONARY is HASHABLE).
- The AVL_DICTIONARY implementation is a balanced tree based implementation
(the generic constraint for this implemetation is COMPARABLE).
You should update all your create instructions by selecting
HASHED_DICTIONARY or AVL_DICTIONARY. In order to ease this code update, the
compiler will warn you that HASHED_DICTIONARY is selected by default. Please
update your code because this is a temporary warning of the compiler.
Some more DICTIONARY classes were also added (among them: DOUBLE_DICTIONARY
can be of interest).
- The SET class has undergone the same transformation (HASHED_SET and
AVL_SET).
- A RING_ARRAY class was added. This COLLECTION is quite similar to
an ARRAY that performs well for all queue operations
(add|remove)_(first|last) thanks to its circular internal representation.
- The TUPLE class is now defined in Eiffel. Thanks to this new
source code implementation, we have added the definition for the `item'
feature definition.
- The ROUTINE, PROCEDURE and FUNCTION classes are also defined in
Eiffel.
- Added a new WEAK_REFERENCE class with the appropriate garbage
collector support.
- Split has been improved in order to reduce C files compilation
after a change.
- Added a new "-profile" option for some profiling. This option is
also available in the ace file (see tutorial/ace/template.ace) and as a
SmartEiffel option in a C mode of the configuration file.
Provided features:
- the profiling output is written in the "profile.se" file;
- for each entry, the "own" and "cumul" times, total and average, are given;
also, the caller features and the called ones are displayed;
- the times are displayed to the microsecond (even if the internal
structures allow for nanoseconds, we're not aware of any systems using
that precision);
- the Eiffel called features are sorted by decreasing number of calls;
- the three runtime functions (root, runinit and atexit) are displayed
first. Those three functions, and above all , are quite interesting
since they give overall figures ( is the time used in
initializing parts of the application before creating the main feature,
while does some tidying-up before the program exits).
Beware that:
- profiled programs take MUCH longer to execute (a lot of, hem, time, is
spent in the kernel merely to, hem, track time...)
- externals are not profiled; they are accounted in the "own" time of their
caller;
- inlined features are not profiled either (only in -boost)
- only POSIX and Windows implementations are available. Users of other
systems are welcome to provide implementations (for details: drop a mail
to the SmartEiffel mailing list). Note that it only affect times (them
being null), but feature calls are still counted.
Thanks to Lothar Scholz for having the idea in the first place.
- Revamped the input-output system to make it more general and more
extensible.
Provided features:
- now streams can be "filtered". It means you can nest them to bring extra
features such as encoding or encryption (among many other things)
- the system streams (std_input, std_output and std_error) can now be
modified or redirected (see the new GENERAL.standard_streams entity). The
`io' entity is now a real wrapper that redirects from std_input and to
std_output.
See also the cluster description on the SmartEiffel site.
- Visitors revisited. The architecture is now ready to be used
(in 1.1 it was but a draft).