Changes in 0.14.0
Release date: 2024-11-06.
Major Changes
Number of major changes: 4
Definition of Type Parameters for Events
Generics are a facility of generic programming that were added in several programming languages such as Java.
They were designed to extend SARL type system to allow “a type or method to operate on objects of various types while providing compile-time type safety”.
A type parameter is an unqualified identifier.
Type parameters are introduced by generic declarations, e.g. of events, classes, interfaces or actions/methods.
A event is generic if it declares one or more type parameters.
A generic event declaration defines a set of parameterized types, one for each possible invocation of the type parameter section.
All of these parameterized types share the same class at runtime.
Documentation: in official documentation
Change details: 1, 2, 3, 4, 5, 6
Transition from Java 17 to Java 21
Since the beginning of its life, SARL supports version 8 (before 2021) and 17 (after 2021) of Java.
However, several modules from Eclipse are now requiring the version 21 of Java.
Consequently, the SARL development team as decided in 2024 to apply to SARL a transition from Java 17 to Java 21.
Version 0.14.0 requires Java 21 as a minimum requirement.
New Product for MacOS Silicon
From version 0.14.0 of SARL, a new OS architecture is officially supported: MacOS Silicon on ARM architecture.
In additional to the previous products for Linux, Windows and MacOS on Intel, the product for MacOS on ARM (Silicon) is now available for download. [more details]
Make easier the scoping of emitted events
From the SARL API, it is possible to scope the receivers of SARL events, with a guard associated to the emit function.
For example, the following code emit the event MyEvent
only to the agents that have there identifier equals to the identifier value
.
emit(new MyEvent) [it.UUID == value]
To make the scope coding more easy, operators have been introduction for comparing Address
(the argument of the scope) to UUID
value, and for comparing Address
to SpaceID
. Therefore the previous code could be simplified to:
emit(new MyEvent) [it == value]
Detailed Changes
1. SARL Language
1.1. SARL Language and Grammar
- Events could be defined with generic type parameters. [more details]
- Implementation of generic events in the event bus of the Janus SRE. [more details]
- Reserve the keyword “protocol” for futur usage. [more details]
- Fixing NPE in MWE2 code builder generator. [more details]
1.2. SARL Validator
- Events could be defined with generic type parameters. Add warning messages related to the use of generic type parameters in events. These messages are related to the code efficiency that is assumed to be lower than for not-generic events. [more details]
- Add missed check of generic arguments when extending a generic super type (class, interface). [more details]
1.3. Java Model Inferrer
- Events could be defined with generic type parameters. Generate specific Java code for generic events. [more details]
- Avoid NPE when the JVM model is partially generated by the model inferrer. [more details]
- Add operator for comparing Address and UUID, and Address and SpaceID. [more details]
3. SARL User Interface
3.1. Eclipse Products
- Enable the building of the macOS product for Apple Silicon. [more details]
- Include the Java Runtime Environment (JRE) in the SARL Eclipse products. [more details]
- Avoid exceptions due to unlinked editors. [more details]
- Activate the SARL debug perspective when a SARL program is suspended for debug. [more details]
- Fixing the links to the examples’ wizards from the welcome page. [more details]
- The information in the “about texts” are injected from the global properties from the BOM. [more details]
4. Janus Run-time Environment
- Implementation of generic events in the event bus of the Janus SRE. [more details]
5.1. janus
- Add more command line options for selecting the type of JVM executor service. [more details]
6. SARL Documentation
6.1. Documentation of the SARL SDK
- Fixing document for the definition of generic events. [1, 2]
6.2. Documentation of tutorials
- Add exercises:
- Fixing the documentation of the TGOB library. [more details]
- Fixing the URL to the source code in the examples’ documentations. [more details]
- Fixing security alert about http connexion. [1, 2, 3, 4, 5, 6, 7]
- Add scripts for updated the hard-coded versions of maven plugins. [more details]
- Code quality:
- Fixing code for removing warnings on boxing and outboxing. [more details]
- CodeQL Action on Github:
- The API documentation is fixed. [more details]
- Upgrade major libraries:
- Java 21: Apply Java 14 syntax for var and instanceof constructs. [more details]
- Eclipse 2024-06. [1, 2]
- Xtext 2.36.0 [1, 2, 3, 4, 5, 6, 7, 8, 9]
- Maven 3.9.9.
8. Changes in the Previous Versions