Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add short explanation on the SARL tool-chain.
Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
e24cf39
commit 9b8329c
Showing
6 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
docs/io.sarl.docs.markdown/src/main/documentation/compilation/Basics.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Basics of the SARL Compilation Process | ||
|
||
[:Outline:] | ||
|
||
## Standard Compilation Process | ||
|
||
The SARL tool-chain is the set of programming tools that are used to perform a multiagent system with SARL. | ||
As illustrated on the following figure, three types of tools are used in sequence in order to create and | ||
run an agent-based system: | ||
|
||
![Standard Compilation Process for SARL Programs](./compilation_process.png) | ||
|
||
|
||
* **SARL Compiler:** The SARL compiler transforms the source SARL language into the target language. | ||
Several target languages may be considered by this compiler. Because most of the agent frameworks are | ||
written in Java, the SARL compiler targets this object-oriented programming language by default. | ||
The SARL compiler translates SARL statements into their object-oriented equivalent statements. Three different | ||
implementations of the SARL compiler are provided: a specific command-line tool ([sarlc](../tools/Sarlc.md)), the Eclipse development | ||
environment plug-in, and a [Maven plug-in](https://mvnrepository.com/artifact/io.sarl.maven/sarl-maven-plugin). | ||
* **Java Compiler:** The files generated by the SARL compiler when it is using the Java generator (see below) are standard Java’s files. They must be compiled with | ||
one of the compilation tools that are available: Eclipse’s ecl, Oracle’s javac, IBM’s jikes... The result from | ||
the Java compilation is a collection of binary files (a.k.a. byte-code files) that may be run by a virtual machine. | ||
* **SARL Run-time Environment:** The SARL Run-time Environment (SRE) is a collection of tools that enables the | ||
run of an agent-based application written with SARL. Such an SRE must implement each service and feature that are | ||
assumed to be provided by the run-time environment. When the target platform is Java-based, the SRE is composed by | ||
a standard Java Runtime Environment (JRE), and the Janus Java library, which provides the base classes for running | ||
agents written with SARL. In this latest example, a command-line tool is provided for launching the Janus platform: | ||
[janus](../tools/Janus.md). | ||
|
||
|
||
## Other Target Languages Than Java | ||
|
||
As explained in the previous section, the default target language for the SARL compiler is the Java object-oriented programming language. | ||
Hopefully,you could configure the SARL compiler for enabling the generation to another target language | ||
|
||
* [Python](./PythonGeneration.md) | ||
|
||
|
||
[:Include:](../legal.inc) | ||
|
37 changes: 37 additions & 0 deletions
37
docs/io.sarl.docs.markdown/src/main/documentation/compilation/PythonGeneration.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Generation to the Python Language | ||
|
||
[:Outline:] | ||
|
||
Python is a widely used high-level programming language for general-purpose programming, created by Guido van Rossum. | ||
As an interpreted language, Python has a design philosophy that emphasizes code readability, and a syntax that allows | ||
programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java. | ||
|
||
## Integration to the Standard Compilation Process | ||
|
||
The Python generator for SARL compiler is included into the SARL tool-chain, as illustrated by the following figure. | ||
|
||
![Standard Compilation Process for SARL Programs](./compilation_process.png) | ||
|
||
## Enabling and Configuring the Python Generator | ||
|
||
For enabling and configuring the Python generator, you must open the dedicated preference page into the SARL development environment. | ||
It is accessible by: | ||
|
||
* opening the menu item: `Window > Preferences`. | ||
* opening the preference section: `SARL > Compiler > Python` | ||
|
||
You should show a dialog box similar to the following figure. | ||
|
||
![Preference Page into the SARL Development Environment](./python_generator_config.png) | ||
|
||
This preference page will enable you to: | ||
|
||
* enable and disable the Python generation; | ||
* configure the Python generator; | ||
* map the Java typenames to their Python equivalents; | ||
* map the Java feature calls to their Python equivalents. | ||
|
||
|
||
|
||
[:Include:](../legal.inc) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+32.9 KB
docs/io.sarl.docs.markdown/src/main/resources/compilation/compilation_process.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+149 KB
...o.sarl.docs.markdown/src/main/resources/compilation/python_generator_config.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.