AniFrame: A Programming Language for 2D Drawing and Frame-Based Animation
Mark Edward M. Gonzales, Hans Oswald A. Ibrahim, Elyssia Barrie H. Ong, Ryan Austin Fernandez
TL;DR
AniFrame addresses the hurdle novice programmers face when engaging in creative coding by introducing a domain-specific language tailored for 2D drawing and frame-based animation. It combines animation-specific data types, operations, and built-in functions with a frame-centric sequencing model, a Python-like syntax, and a static type system with type inference to balance expressivity and accessibility. The paper details the language design, the three-stage ANTLR4-based implementation, and two illustrative use cases (composites and recursion), complemented by a usability study that suggests improved readability and writability. Open-source availability further supports practical adoption and extension for more complex sketches and potential 3D extensions in the future.
Abstract
Creative coding is an experimentation-heavy activity that requires translating high-level visual ideas into code. However, most languages and libraries for creative coding may not be adequately intuitive for beginners. In this paper, we present AniFrame, a domain-specific language for drawing and animation. Designed for novice programmers, it (i) features animation-specific data types, operations, and built-in functions to simplify the creation and animation of composite objects, (ii) allows for fine-grained control over animation sequences through explicit specification of the target object and the start and end frames, (iii) reduces the learning curve through a Python-like syntax, type inferencing, and a minimal set of control structures and keywords that map closely to their semantic intent, and (iv) promotes computational expressivity through support for common mathematical operations, built-in trigonometric functions, and user-defined recursion. Our usability test demonstrates AniFrame's potential to enhance readability and writability for multiple creative coding use cases. AniFrame is open-source, and its implementation and reference are available at https://github.com/memgonzales/aniframe-language.
