Specifications
Introduction

Sagal Framework Specification

Version0.1.0
StatusDraft

1. Abstract

Sagal is a programming framework designed to bring clarity and intent to code by aligning it with natural language constructs. By focusing on grammatical particles, Sagal allows developers to create semantically meaningful and intuitive executable clauses. The framework abstracts system-specific features through primitives, enabling developers to describe complex operations like concurrency or the actor model, without needing to manage the underlying system mechanics directly. This document provides a detailed specification of Sagal's structure, goals, and semantics-driven approach that guide its implementation.

2. Introduction

Sagal is a programming framework that structures code using grammatical particles, similar to those found in natural languages. These particles enable the creation of executable clauses that are both intuitive and semantically meaningful, while still meeting the strict requirements of machine processing.

In Sagal, grammatical particles act as the building blocks of semantics, providing a foundation for logical and expressive programming. This approach empowers developers to write clear, precise code that mirrors human expression, while ensuring that the code retains the rigor and reliability needed for machine execution.

2.1. Purpose

The purpose of Sagal is to redefine how code conveys meaning by aligning programming more closely with natural language. Traditional programming languages often prioritize rigid structures and execution mechanics designed for machine processing, which can overshadow the clarity and intent behind human-readable code and semantics. This creates a disconnect between how humans naturally think and how machines process instructions—a gap that Sagal seeks to bridge.

2.2. Scope

This document serves as the formal specification for the Sagal Framework. It outlines the core grammar, logic, and linguistic principles that define how Sagal operates. However, it does not cover implementation details, performance optimizations, or low-level interactions. Instead, the document abstracts system-specific functionality through the use of primitives, which will be discussed in later sections.

3. Goals and Non-Goals

3.1. Goals

3.1.1. Semantics-Driven

Sagal ensures that parsing rules and evaluation logic are closely tied to the meaning behind the code. By unifying these processes through linguistic constructs, Sagal streamlines and simplifies how developers define both structure and semantics.

3.1.2. Expressive Programming

A key goal of Sagal is to serve as the foundation for creating expressive programming languages. By leveraging its constructs, it enables developers to design languages that closely mirror natural human communication, allowing them to focus more on intent and meaning.

3.1.3. System-Specific Primitives

Sagal abstracts system-specific details through the use of primitives that encapsulate system functionality and capabilities. These primitives allow developers to interact with features like asynchronous operations, concurrency or the actor model using streamlined constructs, without needing to manage the underlying system mechanics directly.

3.2. Non-Goals

Sagal does not focus on implementation specifics, performance tuning, or low-level details, such as interpreter or compiler design. The framework abstracts system-specific interactions, leaving out implementation strategies to the broader community.

4. Table of Contents

The full Table of Contents is dynamically displayed in the sidebar on the left. Please refer to it for easy navigation through the document.