The Ocean
programming
language.
Ocean compiles to native code, catches type errors before your program runs, and automatically releases the memory owned by strings, arrays, and maps when their values leave scope.
View the compiler source ↗2
3
4
5
6
7
8
package main;
import "io";
func main() {
name := "Ocean";
io.Printfln("Hello, {}!", name);
}
Hello, Ocean!
Why Ocean?
Ocean brings familiar syntax and built-in strings, arrays, and maps to a language that gives you direct control over memory. You can write everyday code without managing every allocation by hand, and reach for pointers when you need them.
If you know Go, the packages, functions, and short variable declarations will feel familiar. The difference is in how data lives: Ocean cleans up owned strings, arrays, and maps when their values leave scope, without a garbage collector. Assign an array or map to another variable and its owned contents are copied, so changing the copy does not change the original.
If you know C, you can still work directly with pointers and call C functions. Ocean adds generics and automatic cleanup for owned strings, arrays, and maps. Allocations made with new(T) still need an explicit free(pointer); copying a pointer shares its target rather than copying that object.
How memory works in Ocean →// Create a dynamic array of integers.
original := int[]{1, 2, 3};
// Assignment copies the array.
copy := original;
copy[0] = 42;
// The original stays unchanged.
io.Println(original); // [1 2 3]
io.Println(copy); // [42 2 3]
A few examples
Take a look at the syntax, how arrays behave, and a simple generic type.
Explore the language guide →package main;
import "io";
func main() {
name := "Ocean";
io.Printfln("Hello, {}!", name);
}
Hello, Ocean!
A small program, from source to console output.
Documentation
Development status
Ocean is young and still changing. Expect rough edges and a small standard library. Follow development or contribute on GitHub ↗.