A compiler for the OSKAR programmatic animation language targeting Python.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Ramsey Nasser f47fa181a3 Call fill and stroke when passing colors, add mouse input 4 weeks ago
cases Update tests to new syntax 3 years ago
examples Patch examples to work with new syntax 6 years ago
rosetta Add initial rosetta stone code 6 years ago
src Call fill and stroke when passing colors, add mouse input 4 weeks ago
.gitignore Overhaul code generation phase, remove python dependency 3 months ago
Cargo.lock Overhaul code generation phase, remove python dependency 3 months ago
Cargo.toml Overhaul code generation phase, remove python dependency 3 months ago
Makefile Add Makefile 4 years ago
Makefile.toml Overhaul code generation phase, remove python dependency 3 months ago
README.md Add README 4 weeks ago
build.rs chore: reformat build.rs 3 years ago

README.md

The Oskar Graphics Programming Language

Oskar is a programming language for graphics and animation designed by computer animation pioneer Larry Cuba. It compiles to Python using the py5 Processing wrapper.

Usage

$ cargo install --force cargo-make                  # oskar uses cargo make
$ git clone https://code.emma.coop/ramsey/oskar     # clone the repository
$ cd oskar                                          # enter folder
$ cargo make clone-ruff                             # clone ruff (see below)
$ cargo build --release                             # build compiler
$ ./target/release/oskar compile in.osk             # use compiler 

A manual for the language is being written.

Implementation

The compiler is written in Rust and uses pest to parse Oskar code.

Since Oskar embeds Python and compiles to Python, a Python parser and code generator is required to function. The current implementation uses unpublished internals crates from Ruff, a Python linter and code formatter. The cargo make clone-ruff step described above clones the ruff repository and sets up local dependencies on its internal crates.

Older versions of the compiler used Python itself via pyo3 for parsing and code generation but Python version headaches between Linux and Windows proved painful enough to abandon this approach in favor of an all-Rust solution.

History

The earliest experiments with Oskar go back to Larry's experimenting in Python in the mid-1990s. The first compiler for the language was written by Bryce Summers in 2017 who handed off the work to Ramsey Nasser in 2018. There have been five major versions of the compiler targeting different languages and animation systems.

Name

Oskar is named after early animation pioneer Oskar Fischinger.