How to install and use the AmbientTalk IDE for Eclipse
The AmbientTalk IDE for Eclipse (IdeAT) has been designed to provide a convenient integrated environment in which to build AmbientTalk applications. It extends Eclipse's features to let you quickly create AmbientTalk files and run them. More concretely, the ideAT plugin currently provides:
- Support for Java projects which includes AmbientTalk files.
- An AmbientTalk editor with syntax highlighting, syntax error reporting, brace matching, auto-format, auto-completion of the current identifier and code completion for statements such as if, while, etc.
- Support to run AmbientTalk scripts with interactive console.
- Support to debug distributed AmbientTalk programs (see the REME-D page for further info).
Developing AmbientTalk programs in Eclipse with the IdeAT plugin is highly recommended and is the fastest way to get started.
In order to use IdeAT we recommend to use:
- version 1.5 or newer of Java Development Kit.
- versions 3.5 to 4.3 of Eclipse.
IdeAT can be directly installed from within Eclipse.
First go to "Help -> Install New Software...->Available Software" and cliclk "Add.." to add a new site.
Enter a name and the following URL on the "Location" field and click "OK" button.
You should then see "IdeAT" offered for installation. Click on the "Next ..." button and follow the instructions from there.
From time to time, a new revision of the IdeAT becomes available with new features and bugfixes. When a new version is available (this is usually announced in the AmbientTalk's mailinglist), you should update it using the Software Updates feature in Eclipse.
You can check whether an update is available and, if so, install it as follows:
- Go to "Help-> Check for Updates".
- If there are updates available, select IdeAT and then click "Next".
- In the Update Details dialog, click "Next".
- Read and accept the license agreement and then click Finish. This will download and install the latest version of IdeAT.
- Restart Eclipse.
Here comes a short tutorial how to create a HelloWorld AmbienTalk application with Eclipse. It assumes that you have installed the plugin as described above.
IdeAT does not provide a particular item to create an AmbientTalk project. An AmbientTalk project is any kind of project that contains an AmbientTalk file ( i.e. a file with the .at extension). This means you can create any kind of project and then add AmbientTalk files to it and run them. However, we recommend you to create an AmbientTalk project as a Java project as it will be easier to compile any Java code used by your AmbientTalk application (e.g. GUI classes).
The following figure shows a simple test project which includes three AmbientTalk files: halloWorld.at, concurrentHalloWorld.at and util.at. The Eclipse console shows the result of the execution of the halloWorld.at file.
Note that the test project is a Java project but the src folder is empty as this example does not contain any Java code.
For now, to run an AmbientTalk application you can right click an .at file and "Run As.. -> AmbientTalk Application". Next section we will explain how to customize an AmbientTalk run configuration.
The following figure shows the contents of the concurrentHalloWorld.at file. The result of its execution is shown in the Eclipse console.
This example implements a "hello World" involving two actors. Note that to import futures one can use / which is bound by default to the atlib included with the plugin. In order to refer to other files on the current ambientTalk project, one can use ~. In this example, concurrentHalloWorld.at imports the util.at file which simply defines a sayHallo() method as shown below.
You can also evaluate a piece of code on the fly in a running IAT or a new one. To do so, select a the piece of code in the editor, right click and select the "Run Snippet On" option. This option lists all running IATs and a default "New..." option to run the snippet in a newly created IAT. The following picture shows you how to run the util.at code using this feature.
Note that each Eclipse Console is named with the run configuration name ( set to the at file if the program was run with Run As.. -> AmbientTalk Application") and an iat identifier. In this example, we previously run halloWorld.at and concurrentHalloWorld.at so, two running IAT processes are available apart from the default "New..." option.
The editor also supports auto-completion for AmbientTalk statements by means of CTRL + space and gives suggestions on the current formed word.
Custom Run Configurations
One can also create a Run configuration for an AmbientTalk program. Select the menu item "Run -> Run Configurations.." then double-click "AmbientTalk Application". You must set the "Program" to an at file. In the screenshot we set it to halloWorld.at.
The Arguments tab in "Run configuration.." allows to configure two different kinds of parameters:
- AmbientTalk VM parameters:
- AT_HOME variable ( which stores the path to the AmbientTalk? distribution directory).
- AT_INIT variable (which stores the path of the init.at file).
- atlib (which stores the path if the atlib directory, used to derive the namespaces to the included libraries).
- command line parameters to IAT such as -n (see the command line parameters page for further info).
- Java VM arguments passed to the Java VM launching IAT.
ArgumentTab shows the default values set for the IdeAT plugin, which are defined in the Preference Page (as explained later). You can select your custom location for a particular file/folder by clicking in the "Other:" radio button which enables the "File System.." and "Workspace..." buttons. The first one allows you to select a file/directory external to the Eclipse workspace, while the latter allows you to browse for a file/folder in the Eclipse workspace. For example, the screenshot above shows that AT_INIT variable is set to the init.at file from the workspace test-2 project.
The plugin takes the location of atlib and sets automatically the value of AT_LIBPATH passed to IAT by adding every subfolder as an at namespace. For example, if you select atlib E to /Users/lisa/atlib as shown in the screenshot above, the variable AT_LIBPATH is set by the plugin as follows:
If would like to add a new namespace slot to the default ones, you should set the -DAT_OBJECTPATH variable in the VM command line arguments.
To customize the ideAT plugin go to Eclipse->Preferences..->IdeAT
One can customize the default location of the AT_HOME and AT_INIT variables, and atlib directory. Their value can be set to a file/directory external to the Eclipse workspace (by means of the "File System..." button) or a file/folder in the Eclipse workspace (by means of the "Workspace..." button).
Note that changing this values affects all run configurations. These values can be overridden in a per run configuration basis as explained above.
The ideAT preferences contains a dedicated page for customizing the editor' syntax highlighting as shown below.
Other properties of the editor can be customized using Eclipse's general preferences. For example:
- if you would like to change the font type or size, go to Preferences->General->Appearance->Color and fonts-> Basic an click the "text font" property.
- if you would like to add line numbers to the files, go to Preferences->General->Editors->Text Editors and click on the "Show line numbers" box.
This is first version of the AmbientTalk IDE for Eclipse. Feedback on it is more than welcomed :)
You can send your suggestions and questions to the AmbientTalk mailing-list or report bugs on the Issues section of this website. Please use the "component_ideAT" label for reporting issues.
- The editor sometimes does not update on the fly multiline comments. Try to position the cursor at the begining of the file and add a space, the editor then should properly update them. Anycase, the comments will be properly greyed out if you save and re open the file.
- Changes on color preferences are currenlty not reflected on opened AmbientTalk files. One needs to close and re open them to see the new colors.
- Auto-completion of identifiers does not include currently identifiers defined in the param list of a closure.
- Auto-completion reusing AT parser so that we can take into account AT scoping rules.
- Completion on jlobby.
- "Refactor" option for AT identifiers.
- Generate getters/setters.
- Outline mode for AT files.
- Open/Closing curly braces.
- Implements java interface support.