Difference between revisions of "Liberty Eiffel Programming Environment FAQ"

From Liberty Eiffel Wiki
Jump to navigation Jump to search
 
m (CETUS link removed, no longer valid)
 
(133 intermediate revisions by 21 users not shown)
Line 1: Line 1:
  +
'''Frequently Asked Questions'''
== Is there a SmartEiffel '''mailing list'''?==
 
  +
==General purpose questions about the Liberty Eiffel project==
 
  +
<div id="LibertyName">
Yes! SmartEiffel users and developers can share their experiences
 
  +
===Where does the name "Liberty" come from?===
  +
  +
As most Eiffel hackers know, Gustave Eiffel (after whom the language is named), also built the metal structure of the Liberty Statue.
  +
  +
More trivia:
  +
Some people may also know that I (Cyril) happen to live very near to Belfort, a town renowned for a sculpture of a lion by Auguste Bartholdi. Bartholdi sculpted the metallic sheets that make the Liberty Statue such an awesome sight.
  +
  +
<div id="MailingList">
  +
  +
===Is there a Liberty Eiffel '''mailing list'''?===
  +
</div>
  +
Yes! Liberty Eiffel users and developers can share their experiences
 
and ideas by subscribing to the
 
and ideas by subscribing to the
  +
[mailto:libertyeiffel@librelist.com Liberty Eiffel official mailing list] by just sending an empty email to this address.
[http://SmartEiffel.loria.fr/support/mailing-list.html SmartEiffel official mailing list].
 
   
  +
Please, note that this list is not moderated.
==Is it possible to have the complete '''Eiffel source code of SmartEiffel'''?==
 
  +
Please, stay correct on that list.
 
Since it is the GNU Eiffel Compiler, the complete source
 
code of SmartEiffel is of course in the distribution.
 
The source code for additional libraries is also provided.
 
   
== Is it possible to use SmartEiffel for '''large/commercial applications'''?==
+
===Is it possible to have the complete '''source code of Liberty Eiffel'''?===
  +
Since it is a free (as in freedom) Eiffel Compiler, the complete source
 
  +
code of Liberty Eiffel is of course in the distribution.
It is indeed possible to use SmartEiffel for a large application.
 
  +
The Eiffel source code for additional libraries is also provided.
An Eiffel compiler is a really big project and SmartEiffel itself is fully
 
  +
See also this [[#CommercialApps|FAQ question]] which is related to [[License|licensing]].
  +
  +
<div id="CommercialApps">
  +
  +
===Is it possible to use Liberty Eiffel for '''large/commercial applications'''?===
  +
</div>
  +
  +
It is indeed possible to use Liberty Eiffel for a large application.
  +
An Eiffel compiler is a really big project and Liberty Eiffel itself is fully
 
written in Eiffel.
 
written in Eiffel.
SmartEiffel is completely free and any private company can use
+
Liberty Eiffel is completely free and any private company can use
SmartEiffel freely, and distribute (or sell) freely the
+
it freely, and distribute (or sell) freely the products made with it.
products made with it.
 
 
They do not have to pay royalties.
 
They do not have to pay royalties.
   
 
Also note that <B>only classes which are closely related to the
 
Also note that <B>only classes which are closely related to the
 
compiler itself are under GPL</B> (actually, only the classes of directory
 
compiler itself are under GPL</B> (actually, only the classes of directory
<TT>SmartEiffel/tools</TT> and <TT>install.e</TT> are under GPL).
+
<TT>SmartEiffel/tools</TT> are under GPL).
 
The other classes are <EM>not</EM> under GPL in order to let people completely
 
The other classes are <EM>not</EM> under GPL in order to let people completely
free (i.e. all classes of <TT>SmartEiffel/lib</TT>).
+
free (i.e. all classes of <TT>lib</TT>).
   
Always keep in mind that SmartEiffel doesn't come
+
Always keep in mind that Liberty Eiffel doesn't come
 
with any warranty (please read the COPYING file in the distribution).
 
with any warranty (please read the COPYING file in the distribution).
 
As explained in the header of non-GPL files, the only important thing
 
As explained in the header of non-GPL files, the only important thing
is to kept the header unaltered when the corresponding source file
+
is to keep the header unaltered when the corresponding source file
 
is provided in your product.
 
is provided in your product.
For extended support, donations as well as consulting, see
 
[http://SmartEiffel.loria.fr/support/support.html here].
 
   
  +
<!-- continue update to Liberty here -->
==What is <B>SmallEiffel</B> compared to <B>SmartEiffel</B>?==
 
Sma<B>ll</B>Eiffel is the former name of the Sma<B>rt</B>Eiffel
 
project. We changed because we thought the compiler had become smart
 
enough ;)
 
   
  +
<div id="SmallEiffel">
For a list of changes between the last version of
 
  +
SmallEiffel and the first one of SmartEiffel, have a look
 
  +
===What is <B>SmallEiffel</B> compared to <B>SmartEiffel</B>?===
  +
</div>
  +
Sma<B>ll</B>Eiffel is the former name of the Sma<B>rt</B>Eiffel
  +
project. At some point in time the development team thought the compiler had become smart
  +
enough to warrant a renaming ;) For a list of changes between the various Small-/SmartEiffel versions, have a look
 
[http://SmartEiffel.loria.fr/misc/HISTORY.html#1.0 there].
 
[http://SmartEiffel.loria.fr/misc/HISTORY.html#1.0 there].
   
  +
<div id="HowCanIHelp">
==How can I help?==
 
The best way to help SmartEiffel and its users is probably to <B>pick up
 
some area you're interested in, and develop</B> with SmartEiffel your own library,
 
application, tool, extension, etc., releasing it to other
 
users.
 
   
  +
===How can I help?===
To avoid duplicate efforts, we suggest you have a look to
 
  +
</div>
[http://SmartEiffel.loria.fr/general/repository.html what other people are already doing around SmartEiffel]
 
  +
The best way to help Liberty Eiffel and its users is probably to <B>pick up
and help them if something that's of interest to you is already under work.
 
  +
some area you're interested in, and develop</B> your own code, libraries, tools or extensions with Liberty Eiffel,
There are actually very good things in there, some we were not even
 
  +
and then release them to other users.
aware of, when they were under development ! :)
 
   
  +
A very good way to help us is to follow the
You may have a look to the [http://SmartEiffel.loria.fr/papers/future.html future plans]
 
  +
[[Get involved]] guidelines when you find some problem with Liberty Eiffel.
and have a look into the bugs database (access via the
 
[http://SmartEiffel.loria.fr/support/bug_report.html bug report page].
 
   
  +
===Why don't you <B>change this and add that</B>?! It would be much better/cooler/whatever!===
Finally, you may also consider funding the development of particular
 
features you would like to have.
 
 
Another very good way to help us is to follow the
 
[http://SmartEiffel.loria.fr/support/bug_report.html bug report guidelines] when you
 
find some problem with SmartEiffel.
 
 
==Why don't you <B>change this and add that</B>?! It would be much better/cooler/whatever!==
 
 
People must understand that we can't always do everything. We simply
 
People must understand that we can't always do everything. We simply
 
can't. Because we don't have the time. Whether we like it or not, we
 
can't. Because we don't have the time. Whether we like it or not, we
Line 74: Line 79:
 
can, but we don't do miracles, sorry.
 
can, but we don't do miracles, sorry.
   
Since SmartEiffel is free of charge and open-source, people who do
+
Since Liberty Eiffel is free of charge and open-source, people who do
 
need things we don't provide can always implement them and have them
 
need things we don't provide can always implement them and have them
 
benefit everybody. A good way to do this is to start working on it,
 
benefit everybody. A good way to do this is to start working on it,
and ask other people (i.e. not the SmartEiffel team ;) ) to join and
+
and ask other people (i.e. not the Liberty Eiffel team ;) ) to join and
help. See the [[How can I help?]] question.
+
help. See the [[#HowCanIHelp|How can I help?]] question.
   
 
Alternatively, someone or some company who does need us to implement
 
Alternatively, someone or some company who does need us to implement
 
something may always consider funding a bit the development of
 
something may always consider funding a bit the development of
SmartEiffel... After all, we've even heard that some people were
+
Liberty Eiffel... After all, we've even heard that some people were
 
selling software and making a bit of money with it... ;)))
 
selling software and making a bit of money with it... ;)))
   
==How do I '''keep informed''' about SmartEiffel?==
+
===How do I '''keep informed''' about Liberty Eiffel?===
 
The best way is to keep an eye on our web pages,
 
The best way is to keep an eye on our web pages,
more especially on the [http://SmartEiffel.loria.fr/general/whatsnew.html What's New?] page
+
more especially on the [http://www.liberty-eiffel.org/ Liberty Eiffel main website].
and the [http://SmartEiffel.loria.fr/misc/HISTORY.html History of Changes].
 
   
People who want detailed information may also decide to stay tuned to
 
[http://SmartEiffel.loria.fr/support/mailing-list.html the SmartEiffel mailing-list] or
 
even look at the [http://SmartEiffel.loria.fr/support/bug_report.html bug-tracking system].
 
   
== What <B>documentation</B> is provided with SmartEiffel?==
+
===What <B>documentation</B> is provided with Liberty Eiffel?===
<TD>The documentation provided with SmartEiffel is a transcript of what
+
The documentation provided with Liberty Eiffel is a transcript of what
you can find on the original SmartEiffel Web site, at
+
you can find on the original Liberty Eiffel Web site, see the link to this wiki.
  +
It is related only to the use and internals of Liberty Eiffel (yes,
<A HREF="http://SmartEiffel.loria.fr">http://SmartEiffel.loria.fr</A>.
 
It is related only to the use and internals of SmartEiffel (yes,
 
 
we know we still have to improve it ;) ).
 
we know we still have to improve it ;) ).
  +
<BR>
 
For information and documentation about the Eiffel language, check
+
For information and documentation about the Eiffel programming language, check
 
the links on our
 
the links on our
<A HREF="../general/resources.html"> Internet resources page</A>.
+
[http://SmartEiffel.loria.fr/general/resources.html Internet resources page].
 
Note that we are not aware of any complete Eiffel language manual
 
Note that we are not aware of any complete Eiffel language manual
 
freely available on the Web (yet?).
 
freely available on the Web (yet?).
  +
 
==Why don't you <B>post more messages</B> in newsgroups and/or mailing lists?==
+
===Why don't you <B>post more messages</B> in newsgroups and/or mailing lists?===
  +
First, because we strongly believe that too much information kills information.
 
  +
Scientists call this "cognitive overload". :)
<TD>First, because we strongly believe that too much information kills information.
 
  +
Scientists call this "cognitive overload". :)<BR>
 
 
Second, because we don't have the time. It takes an awful amount of time to follow
 
Second, because we don't have the time. It takes an awful amount of time to follow
 
discussions, whatever their quality. We try to do that. But it's even more
 
discussions, whatever their quality. We try to do that. But it's even more
 
time-consuming to be part of them. So, we often have to choose between
 
time-consuming to be part of them. So, we often have to choose between
posting/mailing, and working directly on SmartEiffel. Since our mailboxes tend
+
posting/mailing, and working directly on Liberty Eiffel. Since our mailboxes tend
 
to overflood, we generally choose the latter :)
 
to overflood, we generally choose the latter :)
  +
  +
===Is it difficult to switch from some commercial Eiffel compiler to Liberty Eiffel?===
  +
If your original Eiffel software only uses simple types like INTEGER,
  +
STRING, ARRAY, BOOLEAN, CHARACTER and DOUBLE, it is usually very simple
  +
to modify your code in order to use Liberty Eiffel.
  +
  +
It is a little bit difficult for simple input/output (used with predefined
  +
''io'') because some features have different names. If your original software
  +
heavily relies for example on the EiffelBase library, it may be '''very difficult'''.
  +
For example, one must keep in mind that SmartEiffel.ARRAY inherit
  +
SmartEiffel.COLLECTION and that ISE library also have a class COLLECTION.
  +
By the way, subclasses of ISE.COLLECTION cannot be used.
  +
The ISE.LINKED_LIST can be used in conjunction with SmartEiffel.ARRAY because
  +
ISE.LINKED_LIST do not inherit ISE.COLLECTION (no clash).
  +
  +
==Questions about Languages and/or Object-Oriented Programming==
  +
  +
<div id="StaticVsDynamicType">
  +
===What is the difference between the Static and the Dynamic Type?===
  +
</div>
  +
The static type of a variable is determined at compile-time, the dynamic type during run-time.
  +
The dynamic type must conform to the static type (it may and often will be the same as the static type).
  +
  +
E.g.: A variable might be declared to refer to an instance of class FRUIT (a_fruit: FRUIT), so the static type is FRUIT, but might be assigned an object of class APPLE (a_fruit := an_apple), which becomes the dynamic type. Obviously, APPLE has to be a descendant of FRUIT in this example.
  +
  +
<div id="DynamicTypePrediction">
  +
===What is type prediction?===
  +
</div>
  +
Type prediction is when the compiler attempts to predict an expression's [[#StaticVsDynamicType|dynamic type]] at compile time.
  +
  +
==Questions about the Eiffel language of the Liberty Eiffel project==
  +
  +
<div id="CaseSensitivity">
  +
===Why is Liberty Eiffel case-sensitive?===
  +
</div>
  +
  +
In fact, like most computer languages, Eiffel does distinguish between upper and lower case. Our decision is simply guided by the goals of legibility, organisation and simplification.
  +
  +
As far as keywords are concerned, it is easier to distinguish them when they are always written in the same way. Thus, we always write '''loop''', rather than '''Loop''' or even '''LoOp'''. We have to get into good habits from now on in other matters too: this rule is going to be generalised so as to be even stricter in future. From now on, lets all get into the habit of writing '''Current''', '''Void''' or '''True''', for example.
  +
  +
Upper case is also used to distinguish class names from other names. Thus, we can know that '''FOO''' is a class name and '''foo''' is not, without having to look elsewhere in the source code.
  +
  +
A final advantage of the upper/lower case distinction is that it allows more precise error messages. What makes work simpler for humans also simplifies it for compilers.
  +
  +
===What is the semantics (meaning) of a <B>manifest string</B>?===
  +
It can certainly be important to know what really happens when you define
  +
a constant STRING attribute by writing, for example:
  +
Message: STRING is "abc"
  +
that constant attribute definition is in fact a compact way of writing:
  +
Message: STRING is
  +
once
  +
create Result.make(3)
  +
Result.extend('a')
  +
Result.extend('b')
  +
Result.extend('c')
  +
end
  +
You realise, of course, that that function definition is a <TT>once</TT> function and
  +
consequently one string and one string only will be created, whatever happens.
  +
When you are investigating performance, you also have to know the difference between:
  +
string := "abc"
  +
and
  +
string := once "abc"
  +
You have probably guessed that, if the instruction without <TT>once</TT>
  +
is in a loop, a new string is created each time that the line in question is executed!
  +
  +
The <TT>once</TT> expression form above is only valid for manifest STRINGs and UNICODE_STRINGs.
  +
Here is an example of a manifest UNICODE_STRING (note the capital U):
  +
unicode_string := once U"abc"
  +
  +
The [[http://SmartEiffel.loria.fr/man/compile_to_c.html compile_to_c]] command's
  +
<TT>-manifest_string_trace</TT> option
  +
allows you to locate unwanted non-once manifest strings.
  +
  +
<div id="ConformanceVsCovariance">
  +
  +
===Can you explain again the difference between <b>conformance</b> and <b>covariance</b>?===
  +
</div>
  +
Our paper [http://SmartEiffel.loria.fr/papers/papers.html#JOT2004" Conformance of agents in the Eiffel language]
  +
has a note p.137 that looks surprising.
 
 
  +
<blockquote>
== Is it possible to do <B>incremental compilation</B> with SmartEiffel?==
 
  +
<i>Note that the previous rules define conformance rules, this has
  +
nothing to do with covariance or contravariance.</i>
  +
</blockquote>
 
 
  +
The concepts are distinct, even though there is a relation between
Because of the SmartEiffel type inference mechanism,
 
  +
them.
SmartEiffel always produces all needed C files from scratch. As old C files
 
are automatically saved, only modified C files are recompiled.
 
See <TT><A HREF="../man/compile.html">man/compile</A></TT> for details.&nbsp;</TD>
 
 
 
  +
Covariance is defined in terms of conformance. But assignment is
  +
''also'' defined in terms of conformance.
 
 
  +
That's exactly, and only, what our paper defines: assignment
== Is there a mechanism to <B>pre-compile</B> libraries?==
 
  +
rules. Those rules were <i>not</i> defined anywhere before. It's
<TD>No, there is no such mechanism in SmartEiffel. But if you're concerned
 
  +
important: <b>it's not that we disagreed with any earlier position. We
about compilation speed, don't worry, pre-computed libraries are not the only way to be fast !
 
  +
just filled a hole in the specification.</b>
Just try SmartEiffel, and you'll see :)
 
 
 
  +
Also note that, even if the agent types notation uses square
== What is the semantics (meaning) of a <B>manifest string</B>?==
 
  +
brackets, it's totally unrelated to the generic classes type notation;
  +
therefore generic classes rules cannot apply (except if proved
  +
otherwise). An agent type is not a generic type, anymore than a tuple
  +
type is a generic type. Those are distinct concepts, only with a
  +
similar notation.
 
 
  +
<P>Conformance is fundamental in any typed language; on the other hand
Bertrand Meyer clearly explains the semantics of manifest strings in
 
  +
covariance is "just" an Eiffel extra. Important, sure, but not as
section 18.5 on page 653 (and previous sections for background) of
 
  +
fundamental as conformance. Our paper never speaks of covariance,
Object-Oriented Software Construction (Second Edition). A manifest string
 
  +
except in the note quoted above, and explained further here. Maybe the
expression (in declaration) is not a constant but a reference to a shared
 
  +
paper should have explained the subtlety in so many words.</P>
object. A variable initialised with a manifest string is equivalent to a
 
  +
once function, so the string may change! For example:
 
  +
<div id="CATCALL">
<BR>
 
  +
===What is a CATCALL?===
<BR><TT>&nbsp;&nbsp;&nbsp;Message: STRING is "abc"</TT><BR>
 
<BR>
+
</div>
  +
In the Eiffel world ''CATCALL'' is about type safety problems which are still present in
is equivalent to
 
  +
the language.
<BR>
 
  +
In Eiffel, CATCALL is a short-hand for ''Changing Availability or Type of CALLs''.
<BR><TT>&nbsp;&nbsp;&nbsp;Message: STRING is</TT>
 
  +
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;once</TT>
 
  +
''Availability'' is about the exportation status of some method.
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;!!Result.make (3)</TT>
 
  +
For example, when a method is redefined, it's exportation status can be
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Result.append_character ('a')</TT>
 
  +
changed too.
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Result.append_character ('b')</TT>
 
  +
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Result.append_character ('c')</TT>
 
  +
''Type of CALLs'' is about some possibly [[Glossary#Covariance|covariant]] redefinition.
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</TT><BR>
 
  +
<BR>
 
  +
<div id="SCOOP">
SmartEiffel implements manifest strings in this way.
 
  +
<BR>
 
  +
===What is SCOOP ?===
<BR>
 
  +
</div>
Be aware that manifest string expression may be written in two ways:
 
  +
<BR>
 
  +
In Eiffel, [[SCOOP]] refers to language support for distributed programming.
<BR><TT>&nbsp;&nbsp;&nbsp;str := "abc"</TT><BR>
 
  +
In the Eiffel world, it is an acronym for ''Simple Concurrent Object-Oriented Programming''.
This is the standard manifest string expression.
 
  +
SCOOP is not yet included in Liberty Eiffel and is certainly its most important missing feature.
<BR>
 
  +
<BR><TT>&nbsp;&nbsp;&nbsp;str := once "abc"</TT><BR>
 
  +
===Is there a style guide for Eiffel source code?===
This is the once manifest string expression.
 
  +
Yes. Source code in Liberty tools and libraries should conform to the [[Coding Style Guide]]. It seems reasonable to use this as a reference for your own project.
<BR>
 
  +
In the first case, <B>new string is allocated</B> each time the line is
 
  +
==Questions about libraries which comes along with Liberty Eiffel==
executed. In the second case you've got a once result like in declaration
 
  +
described above, so the string may have changed.
 
  +
===How should I read a file?===
See <A HREF="../man/compile_to_c.html">man/compile_to_c</A> for the flag
 
-manifest_string_trace which help finding memory leaks from non-once manifest
 
strings.
 
</TD>
 
</TR>
 
 
==How should I read a file?==
 
 
In order to read a file, read a character and then use
 
In order to read a file, read a character and then use
last_character ONLY if if end_of_input has not been reached
+
last_character ONLY if end_of_input has not been reached
 
while reading the character.
 
while reading the character.
 
<BR>
 
<BR>
Line 181: Line 262:
 
previous read failed because end of input has been reached,
 
previous read failed because end of input has been reached,
 
then it is not valid to try to read again.
 
then it is not valid to try to read again.
<BR>
 
 
Example:
 
Example:
<BR><TT>&nbsp;&nbsp;&nbsp;file: TEXT_FILE_READ</TT>
+
file: TEXT_FILE_READ; file_name: STRING
  +
...
<BR>
 
  +
-- ''Assumming here that'' `file' ''and'' `file_name' ''are not'' [[Void|<tt>Void</tt>]]:
<BR><TT>&nbsp;&nbsp;&nbsp;file.connect_to(file_name)</TT>
 
  +
file.connect_to(file_name)
<BR><TT>&nbsp;&nbsp;&nbsp;if file.is_connected then</TT>
 
  +
if file.is_connected then
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from</TT>
 
  +
from
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.read_character</TT>
 
  +
file.read_character
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;until</TT>
 
  +
until
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.end_of_input</TT>
 
  +
file.end_of_input
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;loop</TT>
 
  +
loop
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;io.put_character(file.last_character)</TT>
 
  +
io.put_character(file.last_character)
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.read_character</TT>
 
  +
file.read_character
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</TT>
 
  +
end
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.disconnect</TT>
 
  +
file.disconnect
<BR><TT>&nbsp;&nbsp;&nbsp;end</TT>
 
  +
end
</TD>
 
  +
</TR>
 
  +
If you want to read the file line by line, then <tt>read_line</tt>
  +
or <tt>read_line_in</tt> can be used. But the reading pattern
  +
<B>is different</B>. This is because after the last line of
  +
the file has been read, then the last line is in <tt>last_string</tt>
  +
and has to be used.
  +
Example:
  +
file: TEXT_FILE_READ; file_name: STRING
  +
...
  +
-- ''Assumming here that'' `file' ''and'' `file_name' ''are not'' [[Void|<tt>Void</tt>]]:
  +
file.connect_to(file_name)
  +
if file.is_connected then
  +
from
  +
until
  +
file.end_of_input
  +
loop
  +
file.read_line
  +
if file.end_of_input then
  +
-- The last line of the file does not end with a new
  +
-- line character. Remove this test if you don't care.
  +
std_output.put_string(file.last_string)
  +
else
  +
std_output.put_line(tfr.last_string)
  +
end
  +
end
  +
file.disconnect
  +
end
  +
  +
<B>Note: </B><tt>last_string</tt> always returns the same STRING object, it's up
  +
to you to make a copy if you need to keep the string value.
  +
  +
You can read the examples in tutorial directory from the Liberty Eiffel distribution.
  +
  +
==Questions about the tools of Liberty Eiffel==
  +
  +
===Is it possible to do <B>incremental compilation</B> with Liberty Eiffel?===
  +
Because of the Liberty Eiffel type inference mechanism,
  +
Liberty Eiffel always produces all needed C files from scratch. As old C files
  +
are automatically saved, only modified C files are recompiled.
  +
See <TT>[http://SmartEiffel.loria.fr/man/compile.html man/compile]</TT> for details.
  +
  +
===Is there a mechanism to <B>pre-compile</B> libraries?===
  +
No, there is no such mechanism in Liberty Eiffel. But if you're concerned
  +
about compilation speed, don't worry, pre-computed libraries are not the only way to be fast !
  +
Just try Liberty Eiffel, and you'll see :)
  +
 
 
== Is it possible to use the <B>Boehm-Demers-Weiser garbage collector</B> with SmartEiffel?==
+
===Is it possible to use the <B>Boehm-Demers-Weiser garbage collector</B> with Liberty Eiffel?===
<TD>Yes.
+
Yes.
<BR>You just have to disable the generation of the GC by SmartEiffel
+
<BR>You just have to pass the compiler option -bdw_gc and that should be it.
  +
(option <IT>-no_gc</IT>) and replace it by the BDW library.
 
  +
===How to customise the <B>Garbage Collector</B> for a new architecture?===
Note that the BDW GC
 
  +
</div>
can be easily added because SmartEiffel only uses malloc/realloc/calloc.
 
  +
If your architecture needs special handling to get the GC working
<BR>You can download the BDW library from :&nbsp;
 
<DL COMPACT>
 
<DD>
 
<A HREF="http://www.hpl.hp.com/personal/Hans_Boehm/gc/">http://www.hpl.hp.com/personal/Hans_Boehm/gc</A>&nbsp;</DD>
 
</DL>
 
How to integrate the Boehm-Demers-Weiser garbage collector
 
with SmartEiffel (from a message of Dietmar Wolz) :&nbsp;
 
<OL>
 
<LI>
 
Make the <TT>gc.a</TT> file from the BDW package.
 
Then move this <TT>gc.a</TT> file to <TT>/usr/lib/libgc.a</TT>.
 
&nbsp;</LI>
 
 
<LI>
 
Move <TT>gc.h</TT> the to working directory and add the
 
following lines:&nbsp;</LI>
 
 
<BR><TT>#define malloc(n) GC_malloc(n)&nbsp;</TT>
 
<BR><TT>#define calloc(m,n) GC_malloc((m)*(n))&nbsp;</TT>
 
<BR><TT>#define realloc(p,n) GC_realloc((p),(n))&nbsp;</TT>
 
<BR><TT>#define free(p) GC_free(p)&nbsp;</TT>
 
<LI>
 
instead of calling&nbsp;</LI>
 
 
<BR><TT>&nbsp;&nbsp;&nbsp; "compile -o executable -boost -O root"&nbsp;</TT>
 
<BR>now call &nbsp;
 
<BR><TT>&nbsp;&nbsp;&nbsp; "compile -o executable -boost -O root -no_gc -lgc -include
 
gc.h"&nbsp;</TT></OL>
 
</TD>
 
</TR>
 
 
 
==How to customise the <B>Garbage Collector</B> for a new architecture?==
 
If your architecture need special handling to get the GC working
 
 
(because the stack is not contiguous, because some registers are not
 
(because the stack is not contiguous, because some registers are not
 
written on the stack on `setjmp'...) then you need to implement function
 
written on the stack on `setjmp'...) then you need to implement function
Line 253: Line 345:
 
In order to check the GC, you should be able to run all files of
 
In order to check the GC, you should be able to run all files of
 
the <TT>SmartEiffel/misc/benchmarks/gc</TT> directory.
 
the <TT>SmartEiffel/misc/benchmarks/gc</TT> directory.
  +
</TD>
 
  +
===How is Liberty Eiffel compiled?===
</TR>
 
 
==How is SmartEiffel compiled?==
 
 
With Eiffel optimisation options -boost and -no_gc. The garbage collector is
 
With Eiffel optimisation options -boost and -no_gc. The garbage collector is
indeed useless on the SmartEiffel commands: since
+
indeed useless on the Liberty Eiffel commands: since Liberty Eiffel did not include a GC in its first versions, we were very careful about memory when we developed it.
SmartEiffel did not include a GC in its first versions, we were very careful
 
about memory when we developed it.
 
   
 
With C compilation optimisations turned on (it depends on the C compiler used;
 
With C compilation optimisations turned on (it depends on the C compiler used;
Line 266: Line 354:
 
The resulting executables are stripped.
 
The resulting executables are stripped.
   
  +
<div id="External tools for Liberty Eiffel">
==Can you explain again the difference between <b>conformance</b> and <b>covariance</b>?==
 
Our paper [http://SmartEiffel.loria.fr/papers/papers.html#JOT2004" Conformance of agents in the Eiffel language]
 
has a note p.137 that looks surprising.
 
 
<blockquote>
 
<i>Note that the previous rules define conformance rules, this has
 
nothing to do with covariance or contravariance.</i>
 
</blockquote>
 
 
The concepts are distinct, even though there is a relation between
 
them.
 
 
Covariance is defined in terms of conformance. But assignment is
 
''also'' defined in terms of conformance.
 
 
That's exactly, and only, what our paper defines: assignment
 
rules. Those rules were <i>not</i> defined anywhere before. It's
 
important: <b>it's not that we disagreed with any earlier position. We
 
just filled a hole in the specification.</b>
 
 
Also note that, even if the agent types notation uses square
 
brackets, it's totally unrelated to the generic classes type notation;
 
therefore generic classes rules cannot apply (except if proved
 
otherwise). An agent type is not a generic type, anymore than a tuple
 
type is a generic type. Those are distinct concepts, only with a
 
similar notation.
 
 
<P>Conformance is fundamental in any typed language; on the other hand
 
covariance is "just" an Eiffel extra. Important, sure, but not as
 
fundamental as conformance. Our paper never speaks of covariance,
 
except in the note quoted above, and explained further here. Maybe the
 
paper should have explained the subtlety in so many words.</P>
 
   
  +
==External tools for Liberty Eiffel==
== Is it difficult to switch from some commercial Eiffel compiler to SmartEiffel?==
 
  +
</div>
 
If your original Eiffel software only uses simple types like INTEGER,
 
STRING, ARRAY, BOOLEAN, CHARACTER and DOUBLE, it is usually very simple
 
to modify your code in order to use SmartEiffel.
 
   
  +
<div id="Syntax highlighting">
It is a little bit difficult for simple input/output (used with predefined
 
  +
===Are there editors with support for Liberty Eiffel?===
''io'') because some features have different names. If your original software
 
  +
heavily relies for example on the EiffelBase library, it may be '''very difficult'''.
 
  +
* [https://www.gnu.org/s/emacs/ Emacs] has support for syntax highlighting, indenting, flymake mode, code templates and more. For installation see the article ''[http://www.berenddeboer.net/eiffel/eiffel_and_emacs.html Editing Eiffel code with Emacs]'' from Berend de Boer but you may use the distributed version of <code>[http://git.savannah.gnu.org/cgit/liberty-eiffel.git/plain/work/eiffel.el eiffel.el]</code> (in the work/ directory of the source distribution).
For example, one must keep in mind that SmartEiffel.ARRAY inherit
 
  +
SmartEiffel.COLLECTION and that ISE library also have a class COLLECTION.
 
  +
* [http://www.vim.org Vim] also has similar support for Eiffel and [https://github.com/LibertyEiffel/vim-liberty-eiffel specific additions for Liberty Eiffel]
By the way, subclasses of ISE.COLLECTION cannot be used.
 
  +
The ISE.LINKED_LIST can be used in conjunction with SmartEiffel.ARRAY because
 
  +
* [https://atom.io/ Atom] has an [https://atom.io/packages/language-eiffel Eiffel package] available.
ISE.LINKED_LIST do not inherit ISE.COLLECTION (no clash).
 
  +
  +
* [http://www.macromates.com TextMate] has an [https://github.com/textmate/eiffel.tmbundle Eiffel bundle] available.
  +
  +
* [https://wiki.gnome.org/Apps/Gedit Gedit] offers syntax highlighting.
  +
  +
* [http://www.scintilla.org/SciTE.html SciTE] offers syntax highlighting and folding.
  +
  +
* On Windows [https://notepad-plus-plus.org/ Notepad++] offers syntax highlighting as well.
  +
  +
* [https://www.editpadpro.com/editeiffel.html EditPad Pro] supports several features for Eiffel.
  +
  +
===Is there a GUI or IDE for Liberty Eiffel?===
  +
  +
An [https://github.com/Imhotup/LibertyEiffel-Eclipse-Plugin Eclipse-based IDE] is currently under development as part of [[GSoC]] 2016.
  +
  +
<div id="Liberty Eiffel debugger with GUI">
  +
  +
===Is there a debugger for Liberty Eiffel with a GUI?===
  +
</div>
  +
Currently not. There was a front end for the sedb (SmartEiffel debugger). It is called ''SmartEiffel Embedded Debugger Output Visualiser'' (sedbov). It maps the key command from the sedb to a GUI. You can find it at https://opensvn.csie.org/traccgi/sedbov/wiki/WikiStart. It use the script language TCL/TK with the extension expect. For information look at http://www.tcl.tk.
  +
  +
<div id="It is possible to create graphical applications?">
  +
  +
==GUI Toolkits==
  +
  +
===Is it possible to create graphical applications?===
  +
</div>
  +
  +
The external project [http://notabug.org/GermanGT/eiffel-iup eiffel-iup] is a plugin to the IUP toolkit, that allow a program to run in different systems without changes - the toolkit provides the application portability. Supported systems include: GTK+, Motif and Windows. The plugin is still not complete, but is stable and in continuous development.
  +
  +
<div id="LibertyEiffelWiki">
  +
  +
==External information about Eiffel==
  +
</div>
  +
  +
<div id="Where can i find more information about Eiffel?">
  +
===Where can I find more information about Eiffel?===
  +
</div>
  +
The news group news:comp.lang.eiffel has low post frequency.
  +
  +
<div id="I am a beginner. Where can i find tutorials?">
  +
  +
===I am a beginner. Where can I find tutorials?===
  +
</div>
  +
You should study and compile the examples in the tutorials directory.
  +
  +
Check out [https://eiffel-guide.com/ the Eiffel Syntax Guide], a comprehensive guide to Eiffel syntax for those new to Eiffel.

Latest revision as of 17:15, 18 December 2021

Frequently Asked Questions

General purpose questions about the Liberty Eiffel project

Where does the name "Liberty" come from?

As most Eiffel hackers know, Gustave Eiffel (after whom the language is named), also built the metal structure of the Liberty Statue.

More trivia: Some people may also know that I (Cyril) happen to live very near to Belfort, a town renowned for a sculpture of a lion by Auguste Bartholdi. Bartholdi sculpted the metallic sheets that make the Liberty Statue such an awesome sight.

Is there a Liberty Eiffel mailing list?

Yes! Liberty Eiffel users and developers can share their experiences and ideas by subscribing to the Liberty Eiffel official mailing list by just sending an empty email to this address.

Please, note that this list is not moderated. Please, stay correct on that list.

Is it possible to have the complete source code of Liberty Eiffel?

Since it is a free (as in freedom) Eiffel Compiler, the complete source code of Liberty Eiffel is of course in the distribution. The Eiffel source code for additional libraries is also provided. See also this FAQ question which is related to licensing.

Is it possible to use Liberty Eiffel for large/commercial applications?

It is indeed possible to use Liberty Eiffel for a large application. An Eiffel compiler is a really big project and Liberty Eiffel itself is fully written in Eiffel. Liberty Eiffel is completely free and any private company can use it freely, and distribute (or sell) freely the products made with it. They do not have to pay royalties.

Also note that only classes which are closely related to the compiler itself are under GPL (actually, only the classes of directory SmartEiffel/tools are under GPL). The other classes are not under GPL in order to let people completely free (i.e. all classes of lib).

Always keep in mind that Liberty Eiffel doesn't come with any warranty (please read the COPYING file in the distribution). As explained in the header of non-GPL files, the only important thing is to keep the header unaltered when the corresponding source file is provided in your product.


What is SmallEiffel compared to SmartEiffel?

SmallEiffel is the former name of the SmartEiffel project. At some point in time the development team thought the compiler had become smart enough to warrant a renaming ;) For a list of changes between the various Small-/SmartEiffel versions, have a look there.

How can I help?

The best way to help Liberty Eiffel and its users is probably to pick up some area you're interested in, and develop your own code, libraries, tools or extensions with Liberty Eiffel, and then release them to other users.

A very good way to help us is to follow the Get involved guidelines when you find some problem with Liberty Eiffel.

Why don't you change this and add that?! It would be much better/cooler/whatever!

People must understand that we can't always do everything. We simply can't. Because we don't have the time. Whether we like it or not, we also have other things to do than provide free stuff, modify our compiler and/or libraries to please everybody. We do as much as we can, but we don't do miracles, sorry.

Since Liberty Eiffel is free of charge and open-source, people who do need things we don't provide can always implement them and have them benefit everybody. A good way to do this is to start working on it, and ask other people (i.e. not the Liberty Eiffel team ;) ) to join and help. See the How can I help? question.

Alternatively, someone or some company who does need us to implement something may always consider funding a bit the development of Liberty Eiffel... After all, we've even heard that some people were selling software and making a bit of money with it... ;)))

How do I keep informed about Liberty Eiffel?

The best way is to keep an eye on our web pages, more especially on the Liberty Eiffel main website.


What documentation is provided with Liberty Eiffel?

The documentation provided with Liberty Eiffel is a transcript of what you can find on the original Liberty Eiffel Web site, see the link to this wiki. It is related only to the use and internals of Liberty Eiffel (yes, we know we still have to improve it ;) ).

For information and documentation about the Eiffel programming language, check the links on our Internet resources page. Note that we are not aware of any complete Eiffel language manual freely available on the Web (yet?).

Why don't you post more messages in newsgroups and/or mailing lists?

First, because we strongly believe that too much information kills information. Scientists call this "cognitive overload". :)

Second, because we don't have the time. It takes an awful amount of time to follow discussions, whatever their quality. We try to do that. But it's even more time-consuming to be part of them. So, we often have to choose between posting/mailing, and working directly on Liberty Eiffel. Since our mailboxes tend to overflood, we generally choose the latter :)

Is it difficult to switch from some commercial Eiffel compiler to Liberty Eiffel?

If your original Eiffel software only uses simple types like INTEGER, STRING, ARRAY, BOOLEAN, CHARACTER and DOUBLE, it is usually very simple to modify your code in order to use Liberty Eiffel.

It is a little bit difficult for simple input/output (used with predefined io) because some features have different names. If your original software heavily relies for example on the EiffelBase library, it may be very difficult. For example, one must keep in mind that SmartEiffel.ARRAY inherit SmartEiffel.COLLECTION and that ISE library also have a class COLLECTION. By the way, subclasses of ISE.COLLECTION cannot be used. The ISE.LINKED_LIST can be used in conjunction with SmartEiffel.ARRAY because ISE.LINKED_LIST do not inherit ISE.COLLECTION (no clash).

Questions about Languages and/or Object-Oriented Programming

What is the difference between the Static and the Dynamic Type?

The static type of a variable is determined at compile-time, the dynamic type during run-time. The dynamic type must conform to the static type (it may and often will be the same as the static type).

E.g.: A variable might be declared to refer to an instance of class FRUIT (a_fruit: FRUIT), so the static type is FRUIT, but might be assigned an object of class APPLE (a_fruit := an_apple), which becomes the dynamic type. Obviously, APPLE has to be a descendant of FRUIT in this example.

What is type prediction?

Type prediction is when the compiler attempts to predict an expression's dynamic type at compile time.

Questions about the Eiffel language of the Liberty Eiffel project

Why is Liberty Eiffel case-sensitive?

In fact, like most computer languages, Eiffel does distinguish between upper and lower case. Our decision is simply guided by the goals of legibility, organisation and simplification.

As far as keywords are concerned, it is easier to distinguish them when they are always written in the same way. Thus, we always write loop, rather than Loop or even LoOp. We have to get into good habits from now on in other matters too: this rule is going to be generalised so as to be even stricter in future. From now on, lets all get into the habit of writing Current, Void or True, for example.

Upper case is also used to distinguish class names from other names. Thus, we can know that FOO is a class name and foo is not, without having to look elsewhere in the source code.

A final advantage of the upper/lower case distinction is that it allows more precise error messages. What makes work simpler for humans also simplifies it for compilers.

What is the semantics (meaning) of a manifest string?

It can certainly be important to know what really happens when you define a constant STRING attribute by writing, for example:

Message: STRING is "abc"

that constant attribute definition is in fact a compact way of writing:

Message: STRING is
   once
      create Result.make(3)
      Result.extend('a')
      Result.extend('b')
      Result.extend('c')
   end

You realise, of course, that that function definition is a once function and consequently one string and one string only will be created, whatever happens. When you are investigating performance, you also have to know the difference between:

string := "abc"

and

string := once "abc"

You have probably guessed that, if the instruction without once is in a loop, a new string is created each time that the line in question is executed!

The once expression form above is only valid for manifest STRINGs and UNICODE_STRINGs. Here is an example of a manifest UNICODE_STRING (note the capital U):

unicode_string := once U"abc"

The [compile_to_c] command's -manifest_string_trace option allows you to locate unwanted non-once manifest strings.

Can you explain again the difference between conformance and covariance?

Our paper " Conformance of agents in the Eiffel language has a note p.137 that looks surprising.

Note that the previous rules define conformance rules, this has nothing to do with covariance or contravariance.

The concepts are distinct, even though there is a relation between them.

Covariance is defined in terms of conformance. But assignment is also defined in terms of conformance.

That's exactly, and only, what our paper defines: assignment rules. Those rules were not defined anywhere before. It's important: it's not that we disagreed with any earlier position. We just filled a hole in the specification.

Also note that, even if the agent types notation uses square brackets, it's totally unrelated to the generic classes type notation; therefore generic classes rules cannot apply (except if proved otherwise). An agent type is not a generic type, anymore than a tuple type is a generic type. Those are distinct concepts, only with a similar notation.

Conformance is fundamental in any typed language; on the other hand covariance is "just" an Eiffel extra. Important, sure, but not as fundamental as conformance. Our paper never speaks of covariance, except in the note quoted above, and explained further here. Maybe the paper should have explained the subtlety in so many words.

What is a CATCALL?

In the Eiffel world CATCALL is about type safety problems which are still present in the language. In Eiffel, CATCALL is a short-hand for Changing Availability or Type of CALLs.

Availability is about the exportation status of some method. For example, when a method is redefined, it's exportation status can be changed too.

Type of CALLs is about some possibly covariant redefinition.

What is SCOOP ?

In Eiffel, SCOOP refers to language support for distributed programming. In the Eiffel world, it is an acronym for Simple Concurrent Object-Oriented Programming. SCOOP is not yet included in Liberty Eiffel and is certainly its most important missing feature.

Is there a style guide for Eiffel source code?

Yes. Source code in Liberty tools and libraries should conform to the Coding Style Guide. It seems reasonable to use this as a reference for your own project.

Questions about libraries which comes along with Liberty Eiffel

How should I read a file?

In order to read a file, read a character and then use last_character ONLY if end_of_input has not been reached while reading the character.
Before each read (except the very first), you have to test end_of_input, because all read_* procedures require not end_of_input. But why? This require means that if some previous read failed because end of input has been reached, then it is not valid to try to read again. Example:

file: TEXT_FILE_READ; file_name: STRING
...
-- Assumming here that `file' and `file_name' are not Void:
file.connect_to(file_name)
if file.is_connected then
   from
      file.read_character
   until
      file.end_of_input
   loop
      io.put_character(file.last_character)
      file.read_character
   end
   file.disconnect
end

If you want to read the file line by line, then read_line or read_line_in can be used. But the reading pattern is different. This is because after the last line of the file has been read, then the last line is in last_string and has to be used. Example:

file: TEXT_FILE_READ; file_name: STRING
...
-- Assumming here that `file' and `file_name' are not Void:
file.connect_to(file_name)
if file.is_connected then
   from
   until
      file.end_of_input
   loop
      file.read_line
      if file.end_of_input then
         -- The last line of the file does not end with a new
         -- line character. Remove this test if you don't care.
         std_output.put_string(file.last_string)
      else
         std_output.put_line(tfr.last_string)
      end
   end
   file.disconnect
end

Note: last_string always returns the same STRING object, it's up to you to make a copy if you need to keep the string value.

You can read the examples in tutorial directory from the Liberty Eiffel distribution.

Questions about the tools of Liberty Eiffel

Is it possible to do incremental compilation with Liberty Eiffel?

Because of the Liberty Eiffel type inference mechanism, Liberty Eiffel always produces all needed C files from scratch. As old C files are automatically saved, only modified C files are recompiled. See man/compile for details.

Is there a mechanism to pre-compile libraries?

No, there is no such mechanism in Liberty Eiffel. But if you're concerned about compilation speed, don't worry, pre-computed libraries are not the only way to be fast ! Just try Liberty Eiffel, and you'll see :)


Is it possible to use the Boehm-Demers-Weiser garbage collector with Liberty Eiffel?

Yes.
You just have to pass the compiler option -bdw_gc and that should be it.

How to customise the Garbage Collector for a new architecture?

If your architecture needs special handling to get the GC working (because the stack is not contiguous, because some registers are not written on the stack on `setjmp'...) then you need to implement function `mark_stack_and_registers' for your system in the file SmartEiffel/sys/runtime/c/gc_lib.c.

If you get some message telling you that the stack direction is wrong, then you should change macro definition to use the other generic code (there is one generic code for each stack order).

In order to check the GC, you should be able to run all files of the SmartEiffel/misc/benchmarks/gc directory.

How is Liberty Eiffel compiled?

With Eiffel optimisation options -boost and -no_gc. The garbage collector is indeed useless on the Liberty Eiffel commands: since Liberty Eiffel did not include a GC in its first versions, we were very careful about memory when we developed it.

With C compilation optimisations turned on (it depends on the C compiler used; we generally use gcc). The resulting executables are stripped.

External tools for Liberty Eiffel

Are there editors with support for Liberty Eiffel?

  • Emacs has support for syntax highlighting, indenting, flymake mode, code templates and more. For installation see the article Editing Eiffel code with Emacs from Berend de Boer but you may use the distributed version of eiffel.el (in the work/ directory of the source distribution).
  • Gedit offers syntax highlighting.
  • SciTE offers syntax highlighting and folding.
  • On Windows Notepad++ offers syntax highlighting as well.

Is there a GUI or IDE for Liberty Eiffel?

An Eclipse-based IDE is currently under development as part of GSoC 2016.

Is there a debugger for Liberty Eiffel with a GUI?

Currently not. There was a front end for the sedb (SmartEiffel debugger). It is called SmartEiffel Embedded Debugger Output Visualiser (sedbov). It maps the key command from the sedb to a GUI. You can find it at https://opensvn.csie.org/traccgi/sedbov/wiki/WikiStart. It use the script language TCL/TK with the extension expect. For information look at http://www.tcl.tk.

GUI Toolkits

Is it possible to create graphical applications?

The external project eiffel-iup is a plugin to the IUP toolkit, that allow a program to run in different systems without changes - the toolkit provides the application portability. Supported systems include: GTK+, Motif and Windows. The plugin is still not complete, but is stable and in continuous development.

External information about Eiffel

Where can I find more information about Eiffel?

The news group news:comp.lang.eiffel has low post frequency.

I am a beginner. Where can I find tutorials?

You should study and compile the examples in the tutorials directory.

Check out the Eiffel Syntax Guide, a comprehensive guide to Eiffel syntax for those new to Eiffel.