jcc: Integrating Timed Default Concurrent Constraint Programming into JAVA Vijay Saraswat 1 , Radha Jagadeesan ⋆2 , and Vineet Gupta 3 1 CSE Department, Penn State University, University Park, Pa 16802 2 School of CTI, De Paul University, Chicago Il 60604 3 Google, Inc, Mt View, Ca 94043. Abstract. This paper describes jcc, an integration of the timed default concur- rent constraint programming framework [16] (Timed Default cc) into JAVA [7]. jcc is intended for use in education and research, for the programming of em- bedded reactive systems, for parallel/distributed simulation and modelling (par- ticularly for space, robotics and systems biology applications), and to support the development of constraint-based program analysis and type-checking tools. In fully implementing the Timed Default cc framework, jcc supports the notion of (typed) logical variables (called “promises”, after [5]), allows the programmer to add his/her own constraint system (an implementation of the Herbrand con- straint system is provided), implements (instantaneous) defaults via backtracking, implements a complete renewal of the constraint-store at each time instant, and implements bounded-time execution of the Timed cc control constructs. jcc implements the notion of reactive vats [5] as single threads of execution within the JVM; a vat may be thought of as encapsulating a single synchronous, reactive Timed cc computation. A computation typically consists of a dynami- cally changing collection of interacting vats (some of which could potentially be located at different JVMs), with dynamically changing connectivity. jcc programs fully inter-operate with JAVA programs, and compile into standard JVM byte-code. jcc programs fully respect the JAVA type system; logical vari- ables are typed. jcc is compatible with the Generic Java [3] extensions, thereby allowing the use of parameterized types. Indeed, jcc may be viewed as an exten- sion of JAVA which replaces JAVA’s notoriously difficult imperative thread-based concurrency with the notion of reactive vats interacting via constraints on logical variables. jcc source code is available under the Lesser GNU licence through SourceForge. 4 1 Introduction and Overview While JAVA [7] has been remarkably successful as a new programming language, its treatment of concurrency remains extremely problematic from a conceptual point of view, and extremely difficult from a practical point of view. To a fairly traditional core of strongly-typed class-based object-oriented programming, JAVA adds threads and syn- chronization based on locking mutable objects in a heap shared between all the threads, ⋆ Research supported in part by NSF CCR 0244901 4 The authors wish to thank Daniel Burrows, Lav Rai, Avanti Nadgir and Guilin Chen for their feedback and contributions to the jcc system.