clockwise

module
v0.0.0-...-f282515 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: BSD-3-Clause

README

Clockwise: Advanced Systems Programming Language

Clockwise Logo

OpenSSF Best Practices

Clockwise is a high-performance systems programming language designed to eliminate dependency management complexity while delivering exceptional performance and developer productivity through innovative GoSE (Go CompileR System Environment) integration.

Architecture Overview

Clockwise provides dual compilation modes to meet diverse system requirements:

  • Standard Mode: Full Go runtime integration with garbage collection and comprehensive library support.
  • Freestanding Mode: Zero-runtime deployment with manual memory management for maximum control.

Core Innovation

Traditional systems development faces fundamental challenges: dependency version conflicts, build system complexity, runtime deployment requirements, and external library management. Clockwise addresses these issues through an integrated approach that embeds essential functionality directly within the language.

fn main() -> int {
    // HTTP client - natively integrated
    var resp = HttpGet("https://api.example.com/data");
    
    // JSON processing - built-in functionality
    var data = JSONExtract(resp, "key");
    
    // File operations - native implementation
    WriteFile("output.json", data);
    
    return 0;
}
Compilation
# Standard mode (Go runtime)
cwc build program.cw -o program
./program

# Freestanding mode (zero dependencies)
clockwise-freestanding program.cw -o program
./program  # Deployable anywhere

Compilation Modes

Standard Mode
cwc build program.cw
  • Garbage-collected memory management
  • Goroutines and channels for concurrency
  • Complete Go standard library compatibility
  • Optimized for rapid development cycles
Freestanding Mode
clockwise-freestanding program.cw
  • Zero external dependencies
  • Manual memory management with safety guarantees
  • Direct system call interface
  • C/C++ comparable performance characteristics
  • Independent binary deployment

Installation

Automated Installation

Linux/macOS:

curl -sSL https://codeberg.org/clockwise-lang/clockwise/raw/branch/main/installer.sh | bash

Windows (PowerShell):

iwr -useb https://codeberg.org/clockwise-lang/clockwise/raw/branch/main/installer.ps1 | iex
Manual Installation
git clone https://codeberg.org/clockwise-lang/clockwise.git
cd clockwise
./installer.sh  # Windows: installer.ps1

Installation Components:

  • Clockwise compiler with GoSE backend
  • GoSE compiler with Clockwise frontend
  • Freestanding compiler for runtime-free binaries
  • Complete standard library implementation
  • System PATH integration

Language Features

Integrated Standard Library

Comprehensive built-in modules without external dependencies:

  • HTTP Client: Native HTTP/1.1 and HTTPS support
  • JSON Processing: High-performance parsing and generation
  • File I/O: Cross-platform file system operations
  • Cryptography: Hashing, encryption, and digital signatures
  • Networking: TCP/UDP sockets and network protocols
  • Database: SQLite and PostgreSQL connectivity
  • 50+ additional modules for common system tasks
Performance Characteristics
  • GoSE backend leveraging mature Go compiler infrastructure
  • Native machine code generation with LLVM optimizations
  • Zero runtime overhead in freestanding mode
  • Cross-platform support (Linux, Windows, macOS)
Type System
  • Static typing with compile-time verification
  • Advanced type inference reducing boilerplate code
  • Memory safety guarantees without runtime penalties
  • Null-safe reference handling
Development Environment
  • Single-binary compiler distribution
  • Sub-second compilation times for large projects
  • Precise error reporting with contextual information
  • Integrated formatter, static analyzer, and debugger

Implementation Examples

Network Service (Standard Mode)
fn main() -> int {
    // High-performance HTTP server
    var server = HttpServer("0.0.0.0:8080");
    
    server.handle("/api/data", fn(req) {
        var response = JSONEncode({
            "status": "success",
            "timestamp": TimeNow(),
            "data": ProcessRequest(req)
        });
        return HttpResponse(200, response);
    });
    
    server.start();
    return 0;
}
System Utility (Freestanding Mode)
fn main() -> int {
    var config = ReadConfig("/etc/system.conf");
    var buffer = AllocateBuffer(config.buffer_size);
    
    ProcessData(buffer, config.parameters);
    
    FreeBuffer(buffer);
    return 0;
}
Data Processing Pipeline
fn main() -> int {
    // Concurrent data processing
    var data = HttpGet("https://api.example.com/dataset");
    var parsed = JSONParse(data);
    
    var results = Map(parsed.items, fn(item) {
        return Transform(item);
    });
    
    var output = JSONEncode(results);
    WriteFile("processed.json", output);
    
    return 0;
}

Quick Start Guide

1. Installation
curl -sSL https://codeberg.org/clockwise-lang/clockwise/raw/branch/main/installer.sh | bash
2. Initial Program
echo 'fn main() -> int { Print("Clockwise initialized\n"); return 0; }' > init.cw
3. Compilation and Execution
# Standard compilation
cwc build init.cw -o init
./init

# Freestanding compilation
clockwise-freestanding init.cw -o init-freestanding
./init-freestanding

Development

Clockwise is an open-source project welcoming contributions:

  • Bug identification and resolution
  • Feature development and enhancement
  • Documentation improvement
  • Performance optimization
  • Platform-specific adaptations

Security and Bug Disclosure

If you discover a bug or security issue, please report it via the project's issue tracker on Codeberg: https://codeberg.org/clockwise-lang/clockwise/issues

For sensitive security disclosures, consult SECURITY.md in this repository for contact guidance and responsible disclosure instructions.

Development Setup:

git clone https://codeberg.org/clockwise-lang/clockwise.git
cd clockwise
./build.sh  # Generate development toolchain

Performance Benchmarks

Comparative performance analysis (Ubuntu 22.04, AMD64, HTTP server workload):

Language Runtime Environment Binary Size Startup Latency Memory Footprint
Clockwise (Freestanding) None 2.1MB 0.5ms 1.2MB
Clockwise (Standard) Go Runtime 8.5MB 3.2ms 4.8MB
Go Go Runtime 12.3MB 4.1ms 6.2MB
Rust None 15.7MB 1.8ms 2.1MB
C++ None 18.9MB 0.8ms 1.5MB

Feature Comparison Matrix

Capability Clockwise Go Rust C++ Node.js
Zero Dependencies Yes (Freestanding) No Yes Yes No
Native HTTP Client Yes External External External Yes
Integrated JSON Yes External External External Yes
Memory Safety Yes Yes Yes No Yes
Compilation Speed Excellent Excellent Moderate Poor Excellent
Syntax Simplicity High High Moderate Low High
Complete Toolchain Yes Yes Yes Partial Yes

Development Roadmap

  • Version 1.0: Core language with complete GoSE integration
  • Version 1.1: Enhanced freestanding mode with advanced optimizations
  • Version 1.2: Native GUI framework for desktop applications
  • Version 1.3: WebAssembly compilation target
  • Version 2.0: Distributed computing and microservices framework

License

Clockwise is licensed under the BSD License. See LICENSE for complete terms.

Acknowledgments

  • Go development team for the language and toolchain foundation
  • GoSE project contributors for compiler integration framework
  • Codeberg platform for open-source infrastructure
  • Community contributors for feedback and enhancements

Project Resources

Support the Project

If you find Clockwise useful, consider supporting the project with a donation. Your contributions help us continue to improve and maintain the language.

Donate via Liberapay

Jump to

Keyboard shortcuts

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