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.
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.
Oct is built on Go, leveraging its robust systems substrate to enable portable computation and AI-assisted experimentation. Key characteristics include:
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.
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:
Known limitations are acknowledged, and future updates are anticipated as the project transitions towards a stable 1.0 release.
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.
No comments yet.
Sign in to be the first to comment.