Thanks to visit codestin.com
Credit goes to deepwiki.com

Menu

Overview

Relevant source files

Purpose and Scope

This document provides a comprehensive overview of OwnLang, a dynamic functional programming language implemented in Java. It covers the core language features, system architecture, and development ecosystem. For detailed information about specific language processing stages, see Language Core. For module-specific documentation, see Module System. For build and deployment details, see Build and Distribution.

OwnLang is designed as an interpreted language with a focus on functional programming paradigms while supporting imperative constructs. The system consists of a core runtime engine, an extensible module system, development tools, and a complete build ecosystem.

Sources: program.own1-253 docs/docs/README.md4-5 ownlang-core/src/main/java/com/annimon/ownlang/Version.java1-11

Core Language Features

OwnLang provides a rich set of language constructs demonstrated in the main example program. The language supports both functional and imperative programming styles with dynamic typing.

Basic Language Constructs

The language includes standard programming constructs with modern syntax:

FeatureSyntax ExampleDescription
Variablesword = 2 + 2Dynamic typing with automatic inference
Stringsstr = "a" * 5 + "ba" * 7String concatenation and repetition
Control Flowif (1 <= 2) println "1 = 1"Standard conditional statements
Loopsfor i = 0, i < 10, i = i + 1 { ... }C-style for loops and while loops
Functionsdef sum(a,b) { return a+b }Named function definitions

Advanced Features

OwnLang includes sophisticated features for modern programming:

Sources: program.own3-8 program.own40-49 program.own162-172 program.own1

Data Structures and Type System

OwnLang provides flexible data structures with dynamic typing:

  • Arrays: arr = [1, "text", sum(10, 15), [], ["nested"]]
  • Maps/Objects: map = {"+" : add, "-" : sub, "*" : mul}
  • Multi-dimensional arrays: array = newarray(2, 2, 2, 2)
  • Object property access: object1.arr[0][1] = "str"

The type system supports runtime type checking through the types module, allowing introspection with functions like typeof().

Sources: program.own53-59 program.own82-87 program.own106-114 program.own199-205

System Architecture

The OwnLang system follows a modular architecture with clear separation between language processing, runtime execution, and external modules.

Core System Components

Sources: Based on overall system architecture from provided diagrams

Language Processing Pipeline

The language processing follows a traditional interpreter pipeline with modern optimization stages:

The pipeline includes a semantic linter as a required stage (introduced in version 2.0.0) and supports resource-based program loading with "resource:" prefix.

Sources: docs/docs/en/changelog.md36 docs/docs/en/changelog.md38

Module System Architecture

OwnLang's extensibility comes from its comprehensive module system that provides both standard library functionality and integration with external systems.

Module Interface and Loading

The module system uses a standardized interface where each module implements constants() and functions() methods returning maps of available functionality.

Sources: program.own1 program.own134-158 docs/docs/en/changelog.md47

Development Ecosystem

OwnLang includes a complete development ecosystem with package management, build tools, and documentation generation.

Package Management and Build System

The ecosystem centers around the own package manager introduced in version 2.1.0:

ComponentPurposeUsage Example
Package ManagerDependency managementown init, own add openai
Build SystemMulti-project compilationGradle-based with Shadow JAR
CLI ToolsCode qualityBeautifier, Linter, Optimizer
REPLInteractive developmentJLine integration with completion

Distribution and Deployment

The system supports multiple deployment options including standalone JARs, platform-specific launch scripts, and Docker containers for different execution environments.

Sources: docs/docs/en/changelog.md9-10 ownlang-core/src/main/java/com/annimon/ownlang/Version.java8-10