A Multi-Programming-Language, Multi-Context Framework Designed for Computer Science Education Douglas Blank1, Jennifer S
Total Page:16
File Type:pdf, Size:1020Kb
Bryn Mawr College Scholarship, Research, and Creative Work at Bryn Mawr College Computer Science Faculty Research and Computer Science Scholarship 2012 Calico: a multi-programming-language, multi- context framework designed for computer science education Doug Blank Bryn Mawr College, [email protected] Jennifer S. Kay James B. Marshall Keith O'Hara Mark Russo Let us know how access to this document benefits ouy . Follow this and additional works at: http://repository.brynmawr.edu/compsci_pubs Part of the Computer Sciences Commons Custom Citation Douglas Blank, Jennifer S. Kay, James B. Marshall, Keith O'Hara, and Mark Russo. Calico: A Multi-Programming-Language, Multi- Context Framework Designed for Computer Science Education. (2012). SIGCSE 2012 (Raleigh, NC). This paper is posted at Scholarship, Research, and Creative Work at Bryn Mawr College. http://repository.brynmawr.edu/compsci_pubs/53 For more information, please contact [email protected]. To appear in the Proceedings of the 43rd ACM Technical Symposium on Computer Science Education, SIGCSE 2012 Calico: A Multi-Programming-Language, Multi-Context Framework Designed for Computer Science Education Douglas Blank1, Jennifer S. Kay2, James B. Marshall3, Keith O'Hara4, and Mark Russo1 1Computer Science 2Computer Science 3Computer Science 4Computer Science Department Department Department Program Bryn Mawr College Rowan University Sarah Lawrence College Bard College Bryn Mawr, PA (USA) Glassboro, NJ (USA) Bronxville, NY (USA) Annandale-on-Hudson, NY (1) 610-526-6501 (1) 856-256-4593 (1) 914-395-2673 (1) 845-752-2359 [email protected] [email protected] [email protected] [email protected] ABSTRACT these contexts are often tied to a specific programming environ- The Calico project is a multi-language, multi-context program- ment, which limits their availability to only those willing to work ming framework and learning environment for computing educa- in that programming environment. Similarly, picking a specific tion. This environment is designed to support several interoper- programming environment often limits which contexts one can able programming languages (including Python, Scheme, and a explore. Ideally, educators should be free to choose the most ap- visual programming language), a variety of pedagogical contexts propriate programming languages and, independently, the most (including scientific visualization, robotics, and art), and an as- appropriate themes and contexts for their courses. The choice of sortment of physical devices (including different educational ro- programming language should not limit the context, nor should botics platforms and a variety of physical sensors). In addition, the choice of context limit the programming language. the environment is designed to support collaboration and modern, The Calico project is designed to provide a single framework interactive learning. In this paper we describe the Calico project, for multiple programming environments and multiple contexts so its design and goals, our prototype system, and its current use. that instructors and institutions need not limit their pedagogical choices [3]. Thus, within a single framework, teachers can Categories and Subject Descriptors smoothly transition students from one programming paradigm to another. For example, perhaps an instructor would like students to K.3.2 [Computers and Education]: Computer and Information begin with a Scratch-like language [16] and then move to Python. Science Education – computer science education. Or perhaps the instructor might wish to start with Python and move to Scheme. Both of these transitions are possible in Calico General Terms without changing the computing context, whether it be art, game Design, Experimentation, Languages. development, visualization, or any number of other possibilities. Calico comprises four main components: an interface for Keywords multiple programming languages; an interface for multiple librar- CS1, computer science education, integrated development envi- ies for exploring different computing contexts; an interface for ronment, IDE, pedagogy, programming languages, robots. peer-to-peer communication; and an integrated editor. The lan- guage interface allows for the execution of individual language 1. INTRODUCTION expressions or entire program files, and for the sharing of data and functions across languages. The library interface enables program Today there are many new and exciting programming environ- modules to appear as native objects within all of the available ments and contexts available for learning about computing. For languages. This provides a foundation for exploring computing example, Alice [8] and Scratch [10] provide drag-and-drop, no- contexts, such as graphics and robotics, in a language-independent syntax-errors programming environments, and DrRacket (for- manner. The communication interface provides functionality that merly DrScheme) offers an award-winning integrated error dis- enables users to easily exchange information among themselves. play and logging system for Scheme [11]. Likewise, there are Finally, the editor provides a common framework for editing pro- grams in any language, be it graphical or text-based. many exciting pedagogical contexts for learning about computer science, including media computation [6], story-telling, game We have developed a prototype version of Calico (Figure 1) development, AI, robotics, visualization, and art. Unfortunately, that provides well-tested support for the Python programming language and a personal robotics context (called Myro) for intro- ductory computing, as well as preliminary support for several other languages and contexts. Calico runs on Linux, Macintosh, Permission to make digital or hard copies of all or part of this work for and Windows. This paper describes the prototype version of personal or classroom use is granted without fee provided that copies are Calico, which is currently being piloted in five Fall 2011 CS not made or distributed for profit or commercial advantage and that courses, as well as our broader goals and vision for the system. copies bear this notice and the full citation on the first page. To copy In the ongoing development of the Calico framework, our otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. overall goals are to “raise the ceiling” by including a variety of SIGCSE’12, February 29–March 3, 2012, Raleigh, North Carolina, USA. more sophisticated pedagogical contexts and programming lan- Copyright 2012 ACM 978-1-4503-1098-7/12/02...$10.00. guages, to “lower the floor” by including support for an intuitive Figure 1: Prototype of the Calico shell (left) and editor (right). visual programming language for beginners, and to “widen the As an example, the following Calico Scheme program de- doorway” by including contexts beyond those typically found in fines a recursive function for testing whether an integer is even: traditional computer science, such as scientific visualization and art. scheme> (define is-even? (lambda (n) (cond 2. A MULTI-LANGUAGE ENVIRONMENT ((= n 0) #t) ((= n 1) #f) Users interact with each supported language through the Calico Shell. The shell provides a place for text-based language expres- ((< n 0) (is-even? (- n))) sions to be entered and evaluated interactively, with the results (else (is-even? (- n 2)))))) available for immediate inspection. In many ways, the shell is Ok very similar to other interactive interfaces, such as IDLE, DrRacket, Jython Environment for Students (JES), and many In this example, is-even? is local to Scheme. However, this func- others going back to the read-eval-print loop of Lisp. However, tion can easily be made available to other Calico languages. The Calico offers three significant improvements over these other following code adds the function even to the global environment, interfaces: Calico is completely language-agnostic, users can eas- turning the Scheme function is-even? into a function callable from ily switch between a variety of available languages, and different other Calico languages: languages can share data and functions. Our Calico prototype currently fully supports Python as a scheme> (define! even (func is-even?)) scripting language for students to use. Beyond support for Python, Ok there is preliminary support for Ruby, F# (similar to OCaml), Boo (Python with types), and Scheme. The shell is language-agnostic The user can then dynamically switch to Python, and call the even in that it is not tied specifically to any programming language. function as if it were a native Python function: Languages are dynamically loaded on startup through a simple, standard interface. Once Calico is started, users may switch be- tween loaded languages through a simple key combination (e.g., python> even(9998) Control+5 might be Python, and Control+6 Ruby). True Of course, most users will probably only use a single lan- guage at a time; however, users can mix data structures and func- Conversely, functions defined in Python can be utilized by tions from different languages together. Furthermore, the sharing Scheme programs in a similar fashion. However, an essential of data and functions requires no extra overhead. For example, aspect of Calico's Scheme implementation (and most others, as data need not be “marshaled” (or copied) in order to be accessed well) is that it is properly tail-recursive. The effective depth of by different languages. In addition, functions defined in one lan- Scheme's