Osaka Programming Language

What is Osaka?

Osaka is a programming language written in Python. It contains an interpreter, a bytecode compiler with a virtual machine, and an equivalence system that keeps both execution paths behaving the same. However, Osaka is NOT a production-grade programming language and has not been tested on other systems. Purely for fun :p

Programs are written in .saka files and can be executed using the Osaka CLI.

Language Semantics

Osaka includes several unique semantic rules that control how values, mutations, and runtime behaviour work.

truthaboutgrain

Represents a trusted value. Trusted values are considered reliable and are required for certain operations such as control flow.

truthaboutgrain x = 10;
Say(x);
truthaboutgrain image
grainsoftruth image

grainsoftruth

Represents an uncertain value. Grain values can exist in computations but may not always be suitable for decisions.

grainsoftruth g = 11;

Americaya()

Promotes a value to truthaboutgrain. This is used when a value has been validated or confirmed.

grainsoftruth g = 11;
truthaboutgrain t = Americaya(g);
Say(t);
Americaya image
Getittogether image

Getittogether()

Stabilizes unresolved grain values. This can be used to bring uncertain runtime state into a more consistent condition.

Getittogether();

SataAndagi()

Returns runtime information about the current Osaka environment. The returned value is considered truthaboutgrain.

truthaboutgrain info = SataAndagi();
Say(info);
SataAndagi image
Ah image

Ah()

Acknowledges a variable for mutation. Without this acknowledgement, mutating some variables may produce warnings.

truthaboutgrain nums = [1, 2];
Ah(nums);
push(nums, 3);

youknowsealsright()

Marks a variable as assumed. This suppresses mutation warnings and signals that the developer accepts the current state.

youknowsealsright(x);
youknowsealsright image
Ivebeengot image

Ivebeengot()

Applies legacy protection to a variable. Once applied, the variable cannot be modified later.

truthaboutgrain data = 5;
Ivebeengot(data);

Hecho()

Freezes a variable and prevents any future mutation. It marks the value as complete.

truthaboutgrain result = 42;
Hecho(result);
Hecho image

Collections

Osaka supports lists and maps with indexing.

truthaboutgrain nums = [1, 2];
push(nums, 3);
Say(nums);

truthaboutgrain profile = {"name": "SATA"};
Say(profile["name"]);

Control Flow

Control flow statements such as if and while are intended to operate on truthaboutgrain conditions.

truthaboutgrain ok = 1;

if (ok == 1) {
    Say("ready");
}

Running Osaka

python3 saka.py examples/hello.saka

or install the CLI:

pip install OsakaProgrammingLanguage
osaka hello.saka
Guestbook
Osaka sticker