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
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.
The language includes standard programming constructs with modern syntax:
Feature | Syntax Example | Description |
---|---|---|
Variables | word = 2 + 2 | Dynamic typing with automatic inference |
Strings | str = "a" * 5 + "ba" * 7 | String concatenation and repetition |
Control Flow | if (1 <= 2) println "1 = 1" | Standard conditional statements |
Loops | for i = 0, i < 10, i = i + 1 { ... } | C-style for loops and while loops |
Functions | def sum(a,b) { return a+b } | Named function definitions |
OwnLang includes sophisticated features for modern programming:
Sources: program.own3-8 program.own40-49 program.own162-172 program.own1
OwnLang provides flexible data structures with dynamic typing:
arr = [1, "text", sum(10, 15), [], ["nested"]]
map = {"+" : add, "-" : sub, "*" : mul}
array = newarray(2, 2, 2, 2)
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
The OwnLang system follows a modular architecture with clear separation between language processing, runtime execution, and external modules.
Sources: Based on overall system architecture from provided diagrams
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
OwnLang's extensibility comes from its comprehensive module system that provides both standard library functionality and integration with external systems.
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
OwnLang includes a complete development ecosystem with package management, build tools, and documentation generation.
The ecosystem centers around the own
package manager introduced in version 2.1.0:
Component | Purpose | Usage Example |
---|---|---|
Package Manager | Dependency management | own init , own add openai |
Build System | Multi-project compilation | Gradle-based with Shadow JAR |
CLI Tools | Code quality | Beautifier, Linter, Optimizer |
REPL | Interactive development | JLine integration with completion |
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
Refresh this wiki