Release 0.15.0 of SARL

2 views
Skip to first unread message

Stéphane Galland

unread,
Sep 10, 2025, 8:37:44 AMSep 10
to sarl
Dear all.

I glade to announce the major release of SARL version 0.15.0.
Four major changes are available.

1. Generation of implicit event constructors


In SARL, events are fundamental constructs for agent communication, often requiring explicit constructor definitions to initialize their fields. Prior to this change, developers had to manually define constructors for every event, even when the event’s structure was simple or followed a predictable pattern. This manual process introduced several inefficiencies:

  • Repetitive constructor definitions for events with standard field initializations.
  • Manual constructor writing increased the risk of inconsistencies or omissions, especially in large codebases.
  • Developers spent unnecessary time on repetitive tasks, detracting from core logic implementation.

To streamline event definition and improve developer productivity, SARL introduced automatic constructor generation for events. This feature:

  • Infers Constructors from Field Declarations:

The compiler automatically generates constructors based on an event’s declared fields, eliminating the need for manual implementation. Example:

event MyEvent { var description : String var payload : double }

The SARL compiler now automatically generates constructors that are equivalent to the following SARL code:

event MyEvent { var description : String var payload : double new (description : String = null, payload : double = 0.0) { this.description = description this.payload = payload } }

2. Space API outside the Janus SRE


In earlier versions of SARL, the Space Implementation API was tightly coupled with the Janus SRE (SARL Runtime Environment). This design choice introduced several limitations:

  • The API’s integration within SRE-specific code restricted its reusability in alternative runtime environments or custom implementations.
  • Developers could not leverage the Space API independently of SRE, limiting the portability of agent-based systems.
  • Changes to the SRE could inadvertently affect the Space API, complicating updates and extensions.

These constraints hindered SARL’s goal of providing a generic, modular, and runtime-agnostic agent programming framework. To address these issues, the Space Implementation API was moved from the SRE codebase to the SARL SDK. The Space API is now part of the SARL standard library, making it independent of any specific runtime environment. The API was redesigned to rely on abstract interfaces and runtime-agnostic contracts, ensuring compatibility with any SARL-compliant environment. Key abstractions, such as Space and SpaceSpecification, are now defined in the SARL SDK, while concrete implementations (e.g., SRE-based) are provided as plugins or extensions.

Existing SRE-based applications continue to function seamlessly, as the SRE now implements the generic Space API rather than defining it.

3. Library for creating agent working memory


Agent-based systems often require temporary storage and efficient manipulation of data during their execution, particularly for tasks such as reasoning, decision-making, or maintaining contextual state. Prior to this change, SARL lacked built-in utilities for managing such short-term data structures. Developers had to rely on ad-hoc solutions—such as custom collections or external libraries.

SARL 0.15 introduced a simple “working memory” utility toolset. The working memory utilities are directly accessible within agent behaviors with the WorkingMemory capacity, enabling seamless interaction with other SARL constructs. A default skill is provided for implementing the WorkingMemory capacity based on data structure that maps knowledge names (or identifiers) to their values.


4. Robust Type Checker for Type Parameters

SARL supports generic constructs, such as parameterized events, to enable flexible and reusable agent-based systems. However, prior to the recent update, SARL’s type checking mechanism—built on the Xtext framework—lacked robust validation for type parameter conformance. This limitation led to several challenges:

  • Insufficient compile-time validation of type parameters could result in undetected type mismatches, manifesting as runtime exceptions.
  • Developers could not fully leverage advanced generic programming features, such as bounded polymorphism or variance annotations, due to the absence of a dedicated type conformance checker.

To overcome these limitations, SARL implemented a dedicated type checker that builds upon the existing Xtext framework. This enhanced checker ensures that generic type arguments adhere to their specified bounds (for example, T extends Number). Additionally, it validates conformance in subtype hierarchies and enforces correct type relationships within inheritance chains and interface implementations, including complex scenarios.

Reply all
Reply to author
Forward
0 new messages