Talks
Events

Super-fun with First-class Shapes in Quil

Elena Machkasova, Ryan McArthur, Thomas Hagen at Clojure/conj 2015

Quil is a very popular Clojure graphical library that is used in a variety of projects and is often introduced to beginner Clojure programmers. A recently developed functional mode ("fun-mode") middleware by Nikita Beloglazov introduces MVC approach that allows for a purely functional state manipulation. However, even in the fun-mode Quil drawing functions draw shapes (rectangles, ellipses, etc) directly on the canvas in an imperative programming style. Our "super-fun" addition to Quil allows shapes to be used as first-class entities in a program: a user defines a shape without drawing it (or even without specifying a position at which it would be drawn). Simple shapes and user-imported images can be combined into complex shapes using "above", "beside", and similar functions. A "draw-shape" function draws the entire shape on the canvas at a specified location. Together with the fun-mode, this approach simplifies working with graphics and provides abstraction over the majority of imperative features of Quil. This is especially important for beginner programmers since they can concentrate on functional approaches, and yet enjoy creating complex dynamic interactive graphics without getting stuck on tedious low-level details. The project has been modeled after beginner-friendly graphical library in Racket.

About the speakers: Elena Machkasova has been teaching computer science at University of Minnesota, Morris, an undergraduate public liberal arts college, since 2003. Her Ph.D. is from Boston University. For the last couple of years she has been working with students on a project ClojureEd that focuses on putting together a CS1 course (a first course that students would take in a CS major or a minor) that incorporates Clojure.

Thomas Hagen is a third year undergraduate at U of M Morris and a relatively new Clojure user. In-between managing Computer Science Club, Magic: The Gathering Club, and Super Smash Bros Club, as well as co-hosting the schools “Coding Dojos”, he likes to take a break with a cup of tea and a guitar.

Ryan McArthur currently attends University of Minnesota, Morris for an undergraduate degree in computer science. He only recently started using Clojure, primarily the graphical libraries, and is enjoying the experience.