PitchHut logo
Oct
A scientific programming language for reproducible research.
Pitch

Oct is a scientific programming language and toolchain designed for reproducible research. Built on Go, it combines a high-level scientific interface with seamless access to the Go ecosystem, allowing for fast, native binary execution. Ideal for experiments that require more than simple scripts, Oct provides integrated testing, packaging, and artifact management for robust scientific workflows.

Description

Oct is a versatile scientific programming language and toolchain designed specifically for reproducible research. This tool serves as a bridge where typical notebooks and scripts reach their limits—providing comprehensive support for complex experiments that necessitate testing, units, artifacts, packages, native binaries, and an effective distribution system. The core philosophy guiding Oct is the principle that achieving correctness should be simplified and intuitive.

Key Features of Oct

Oct is built on Go, leveraging its robust systems substrate to enable portable computation and AI-assisted experimentation. Key characteristics include:

  • First-Class Scientific Features: Oct includes critical features such as SI units, xUnit-style testing, arrays, vectors, matrices, and native Einstein tensor notation. The objectives of experiments are embedded as fundamental aspects of the language.
  • Reproducibility by Default: Tests, artifacts, package manifests, and optional lockfiles are integrated into the standard workflow to promote reproducibility.
  • Native Distribution Path: This implementation compiles through Go, allowing the production of traditional native binaries suitable for various platforms.
  • Explicit Integration: Octxiliary wrappers expose Go libraries via clearly defined manifests, avoiding hidden dependencies and fostering transparency.
  • Agent-Friendly Workflow: With capabilities for large language models (LLMs) to create and run Oct experiments, generate artifacts, and produce reproducible code, Oct caters to cutting-edge AI-assisted environments.

Example Usage

Here's a sample demonstrating the language's features:

package ReadmeDemo

fn KineticEnergy(mass: Float<kg>, velocity: Float<m/s>) -> Float<kg*m^2/s^2> {
    return 0.5 * mass * velocity * velocity
}

fn AverageSpeed(distance: Float<m>, time: Float<s>) -> Float<m/s> ! Error {
    if time <= 0.0s {
        return error("time must be positive")
    }
    return distance / time
}

flow HeatReactor(target: Float<K>, initial: Float<K>) -> Float<K> {
    board {
        Temp: Float<K>
        Ticks: Int
    }
    state Initialize {
        board.Temp = initial
        board.Ticks = 0
        goto Heating
    }
    state Heating {
        board.Temp += 0.5K
        board.Ticks++
        when {
            case board.Temp >= target -> goto Done
            case board.Ticks > 1000 -> goto Done
            else -> goto Heating
        }
    }
    state Done { return board.Temp }
}

In this example, physical units are enforced at compile time, ensuring correctness in scientific calculations. The capability to construct state machines as an inherent language feature enhances the clarity and organization of experiments.

Current Status: v0.1 Preview

As of version 0.1, Oct is in an early preview stage. The language is capable of running, testing, and compiling scientific programs while continuing to evolve. Current features include:

  • Core language and toolchain
  • Interpreted and compiled execution paths
  • A minimum viable product (MVP) for package management
  • First-party registry for package tracking

Known limitations are acknowledged, and future updates are anticipated as the project transitions towards a stable 1.0 release.

Development and Testing

To facilitate smooth development, several commands are available for testing and managing projects directly from the repository. These commands streamline the building and running of Oct programs, enabling a fluid workflow for scientific programming applications.

For additional guidance and documentation, references are available such as architecture overviews, CLI references, and comprehensive language specifications to assist users in fully leveraging Oct in their research endeavors.

0 comments

No comments yet.

Sign in to be the first to comment.