Skip to content

Commit

Permalink
[docs] Add short explanation on the SARL tool-chain.
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Aug 31, 2017
1 parent e24cf39 commit 9b8329c
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 1 deletion.
@@ -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)

@@ -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)

5 changes: 5 additions & 0 deletions docs/io.sarl.docs.markdown/src/main/documentation/index.md
Expand Up @@ -78,6 +78,11 @@

* [Basic Object-Oriented Programming Support](./reference/OOP.md)

## Compilation and Generation Infrastructure

* [Basics of the SARL Compilation Process](./compilation/Basics.md)
* [Generation to the Python Language](./compilation/PythonGeneration.md)

## Other Tools

### Syntax Highlightning
Expand Down
Expand Up @@ -10,7 +10,7 @@ SRE executes or interprets compiled SARL code on an "hardware platform."
The figure below illustrates the compilation process of a SARL program in which the
run-time environment is involved.

![SARL Generation Process](http://www.sarl.io/images/compilation-process.png)
![SARL Generation Process](../compilation/compilation_process.png)

The Tiny Multiagent Platform (tinyMAS) is a very small software platform, which permits to implement
and run agent-based systems. This platform was written by St&eacute;phane GALLAND and Nicolas GAUD for the
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9b8329c

Please sign in to comment.