ENGINEERING INTERNAL DOMAIN-SPECIFIC LANGUAGE SOFTWARE FOR LATTICE-BASED SIMULATIONS

Modern high-level programming languages are making it practical to develop internal domain-specific languages (DSL) for even computationally intensive applications such as complex systems simulations. We present a prototype DSL to implement lattice-based operations for a whole family of simulation models on different lattices and with different neighbourhood localities. We use closure techniques to switch between lattice geometries and neighbourhoods at run-time. We show how a framework can be implemented in both C++ and Java and that a fluent interface DSL command-line layer and a graphical interface layer can both use this same framework. We find that we can drastically speed up the development and testing of a new simulation model that fits our DSL pattern and demonstrate this with significantly reduced lines of code needed for an incrementally added new model. We present results based on two-dimensional lattice models with discrete cell states for topologically square, hexagonal and triangular geometries and describe how these ideas generalise to higher dimensional problems. We also discuss how the use of internal domain specific languages and tools can facilitate further rapid development of other simulation codes and models.

[1]  Erwin Frey,et al.  Coexistence versus extinction in the stochastic cyclic Lotka-Volterra model. , 2006, Physical review. E, Statistical, nonlinear, and soft matter physics.

[2]  R. Axelrod The Dissemination of Culture , 1997 .

[3]  Ken A. Hawick,et al.  Bit-Packed Damaged Lattice Potts Model Simulations with CUDA and GPUs , 2011 .

[4]  Katarzyna Sznajd-Weron,et al.  Opinion evolution in closed community , 2000, cond-mat/0101130.

[5]  Formation of space-time structure in a forest-fire model , 1993, cond-mat/9310059.

[6]  K. Kawasaki Diffusion Constants near the Critical Point for Time-Dependent Ising Models. I , 1966 .

[7]  Don S. Batory,et al.  Achieving extensibility through product-lines and domain-specific languages: a case study , 2000, TSEM.

[8]  Robert W. Sebesta,et al.  Concepts of programming languages , 1973 .

[9]  Ken A. Hawick Engineering domain-specific languages and automatic code generation for computational simulations of complex systems , 2011 .

[10]  Paul Meakin,et al.  Fractals, scaling, and growth far from equilibrium , 1998 .

[11]  Nuno Oliveira,et al.  Comparing general-purpose and domain-specific languages: An empirical study , 2010, Comput. Sci. Inf. Syst..

[12]  Kenneth A. Hawick,et al.  A Minimal Spatial Cellular Automata for Hierarchical Predatory Prey Simulation of Food Chains , 2010, CSC.

[13]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[14]  Kenneth A. Hawick,et al.  Regular Lattice and Small-World Spin Model Simulations Using CUDA and GPUs , 2010, International Journal of Parallel Programming.

[15]  Martin Fowler,et al.  Domain-Specific Languages , 2010, The Addison-Wesley signature series.

[16]  John Savage,et al.  Groovy Programming: An Introduction for Java Developers , 2006 .

[17]  Arie van Deursen,et al.  Domain-specific languages: an annotated bibliography , 2000, SIGP.

[18]  Dewayne E. Perry,et al.  Metrics and laws of software evolution-the nineties view , 1997, Proceedings Fourth International Software Metrics Symposium.

[19]  M Mernik,et al.  When and how to develop domain-specific languages , 2005, CSUR.

[20]  Ken A. Hawick Complex Domain Layering in Even-Odd Cyclic State Rock-Paper-Scissors Game Simulations , 2011 .

[21]  C. Kittel Introduction to solid state physics , 1954 .

[22]  Christopher G. Langton,et al.  Studying artificial life with cellular automata , 1986 .

[23]  M. Eden A Two-dimensional Growth Process , 1961 .

[24]  Charles Consel Domain-Specific Languages: What, Why, How , 2002, Electron. Notes Theor. Comput. Sci..

[25]  Martin Karlsch,et al.  A model-driven framework for domain specific languages demonstrated on a test automation language , 2007 .

[26]  Master Gardener,et al.  Mathematical games: the fantastic combinations of john conway's new solitaire game "life , 1970 .