Skip to content

charleskoffler/clprolf

Repository files navigation

Clprolf — Clear Programming Language & Framework

A structured approach to object-oriented programming. Roles and responsibilities become explicit.

Clprolf is a structured object-oriented language and framework that adds a conceptual layer on top of Java/C#/PHP.

Roles, contracts, and structural rules are first-class language elements. You model systems with agents, worker agents, versions, and capacities, while the compiler enforces clarity.

If you clone the repository and find value in the project, please consider giving it a ⭐.


Scope and Positioning

Clprolf is not intended as a mainstream replacement for Java or other general-purpose languages.

It is designed for:

  • educational contexts focused on architectural clarity,
  • complex systems,
  • simulation and MAS-like applications,
  • systems requiring strong predictability and structural discipline.

Clprolf introduces explicit structural constraints through predefined roles and natures. These constraints are intentional and form part of the language’s philosophy.

Developers who prefer unrestricted class modeling and complete architectural freedom may find traditional object-oriented languages more suitable.

Clprolf is intended for contexts where early architectural control and long-term coherence are primary objectives.


🚀 Why Clprolf?

  • Safer architecture: compile-time errors prevent invalid dependencies
  • Clear concurrency: intent expressed with one_at_a_time, turn_monitor, etc.
  • Readable design: class roles (agent, worker_agent, model) explain themselves

📝 Quick Example

public class_for agent OrderService {
    with_compat OrderRepository repo;
    void checkout(Order o) { repo.save(o); }
}

In plain OOP: architectural intent often remains implicit. With Clprolf: contracts explicit, roles clear, design rules enforced.


✨ Key Ideas

  • Role-based classes: agent, worker_agent, model, information, indef_obj

  • Modifiers for real-world complexity: long_action, one_at_a_time, dependent_activity

  • Works two ways:

    • Framework (annotations for Java, C#, PHP 8+)
    • Language (compiles into pure Java)

🎯 Perfect For

  • Teaching OOP and architectural thinking through structural guarantees
  • Large simulations & multi-agent systems
  • Scientific prototypes with interacting “actors”

👉 With Clprolf, your code doesn’t just run — it explains itself.


Foundational Principles of Clprolf

Clprolf is based on two core principles:

  1. A class is either technical or organized around a well-defined class domain.
  2. Inheritance must preserve the class domain; if it does not, composition is used instead.

These principles define how Clprolf structures components and relationships.


The class domain is the central subject around which a class is organized. It defines what the class fundamentally represents and what it is responsible for.

For example:

  • A File class has a class domain related to file handling.
  • A Random class has a class domain related to random generation.
  • A Connection class has a class domain related to connection management.
  • A PdfGenerator class has a class domain related to PDF generation.

A technical class, by contrast, does not represent a conceptual domain. It provides technical support (e.g., logging, parsing, low-level utilities).


📚 Documentation — Official Clprolf Materials

Explore the complete set of official Clprolf documents. From the Language Reference Manual to focused thematic guides and conceptual insights, each resource is designed to help you understand and master the language with clarity and precision.


🧭 Start Here

  • 🚀 Getting Started with Clprolf A practical introduction showing how Clprolf makes architectural intent explicit — with real examples and enforced structural rules.

🧠 Main Documentation


⚙️ Clprolf Compiler and Frameworks

Clprolf comes with both a full compiler and lightweight annotation-based frameworks, allowing you to use the language concepts directly in Java, C#, or PHP.


🧩 Clprolf Compiler

  • Clprolf Compiler Directory The official compiler of the Clprolf language — built in Java 8 using ANTLR grammar. It translates .clp source files into pure Java, enforcing semantic rules and role coherence.

🧱 Clprolf Frameworks

Framework versions let developers use Clprolf concepts as annotations inside host languages. They bring the same clarity and role enforcement — without leaving your familiar environment.


🔬 Extended Documentation


🧩 Source Examples — Explore the Language in Action

Discover how Clprolf comes to life through concrete examples — from simple demonstrations to full applications and design patterns. Each directory showcases a different facet of the language: clarity, structure, and algorithmic expressiveness.