olang

command module
v0.0.0-...-203d217 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 16 Imported by: 0

README

O Language

System Oriented Functional Programming Language (SOFPL)

Go Report Card

Overview

O Language is a modern programming language that combines functional programming paradigms with system-level programming capabilities. It's designed to be simple, efficient, and powerful for building system applications.

Features

  • Functional Programming: First-class functions, immutability, and higher-order functions
  • System Programming: Direct system access, process management, and file operations
  • Simple Syntax: Clean, readable syntax inspired by functional languages
  • Cross-Platform: Support for Linux, macOS, Windows, and BSD systems
  • Package Management: Built-in package system with .olp files
  • REPL: Interactive development environment
  • Compilation: Compile to bytecode for better performance

Quick Start

Installation
# Clone the repository
git clone https://gitlab.com/olanguage/olang.git
cd olang

# Build from source
make build

# Install to system (optional)
make system-install
Basic Usage
# Start interactive REPL
./olang

# Run a file
./olang run examples/hello.ola

# Execute code directly
./olang exec 'output("Hello, World!")'

# Compile to bytecode
./olang compile -f input.ola -o output.obc
Hello World
# hello.ola
output("Hello, World!")

Documentation

Comprehensive documentation is available in the docs/ directory:

Language Examples

Basic Operations
# Numbers and arithmetic
output(2 + 3)        # 5
output(10 * 4)       # 40

# Arrays
numbers = [1, 2, 3, 4, 5]
output(len(numbers))     # 5
output(first(numbers))    # 1
output(last(numbers))     # 5

# Functions
add = function(a, b):
    return a + b

output(add(5, 3))    # 8
Control Flow
# Conditional logic
x = 10
if x > 5:
    output("x is greater than 5")
else:
    output("x is not greater than 5")

Development

Build System

The project uses a comprehensive Makefile with various targets:

# Development
make build           # Build the project
make test            # Run tests
make dev             # Build and run in dev mode
make clean           # Clean build artifacts

# Quality checks
make fmt             # Format code
make vet             # Vet code
make lint            # Run linter
make quality         # Run all quality checks

# Cross-platform builds
make build-all       # Build for all platforms
make release         # Create release package

# Documentation
make docs            # Show documentation info

# Tools
make install-tools   # Install development tools
make deps            # Update dependencies
Project Structure
olang/
├── main.go              # Main entry point
├── lexer/               # Lexical analysis
├── parser/              # Syntax parsing
├── compiler/            # Code compilation
├── evaluator/           # Code evaluation
├── ast/                 # Abstract syntax tree
├── object/              # Runtime objects
├── vm/                  # Virtual machine
├── repl/                # Read-eval-print loop
├── builtin/             # Built-in functions
├── docs/                # Documentation
├── tests/               # Test files
├── _scripts/            # Build scripts
├── _jenkins/            # Jenkins configuration
└── Makefile            # Build automation

Commands

O Language provides a rich command-line interface:

# Main commands
olang run <file>         # Run O Language file
olang exec <code>        # Execute code directly
olang compile <file>     # Compile to bytecode
olang install            # Install package dependencies
olang info               # Show system information

# Package management
olang generate           # Generate package file
olang create             # Create new project
olang get <package>      # Get package sources

# Process management
olang process --start    # Start process
olang process --stop     # Stop process
olang process --init     # Initialize process file

Package Management

O Language uses .olp files for package management:

# Install dependencies
olang install

# Create new project
olang create --name "myproject" --repo "https://example.com/repo.git"

# Generate package file
olang generate

Docker Support

# Build Docker image
make docker

# Or use the script directly
./_scripts/docker-build.sh --tag latest --push

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Quick Contribution Guide
  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: make test
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

See CHANGELOG.md for a history of changes.

Support


O Language - System Oriented Functional Programming for the modern era.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Readline is a pure go implementation for GNU-Readline kind library.
Readline is a pure go implementation for GNU-Readline kind library.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL