Fork me on GitHub

General Syntax Reference of he SARL Language

SARL is designed to facilitate the creation of agent-based systems. It combines agent-specific constructs with several functional, imperative and object-oriented principles, providing a robust framework for developing autonomous and interactive agents. Below is an overview of the core features of SARL.

1. Basic Language Constructs

1.1. Structure of SARL Scripts

1.2. Variables and Types

1.3. Literals and Operators

1.4. Feature Access

2. Control Flow

2.1. Conditional Statements

2.2. Loops

3. Functions and Lambda Expressions

3.1. Function Declarations

3.2. Lambda Expressions

4. Advanced Features

4.1. Error Handling and Code Quality Improvement

4.2. Synchronization of Resources

4.3. Extensions and Metaprogramming

5. References

This documentation is based on documentations from the Xtext and Xtend projects, and from the Java tutorials. Thank you to the contributors to these documents.

6. Version Specification

Copyright © 2014-2025 SARL.io, the Original Authors and Main Authors.

Documentation text and medias are licensed under the Creative Common CC-BY-SA-4.0; you may not use this file except in compliance with CC-BY-SA-4.0. You may obtain a copy of CC-BY-4.0.

Examples of SARL code are licensed under the Apache License, Version 2.0; you may not use this file except in compliance with the Apache License. You may obtain a copy of the Apache License.

You are free to reproduce the content of this page on copyleft websites such as Wikipedia.

Generated with the translator docs.generator 0.15.1.