Babelsberg/JS - A Browser-Based Implementation of an Object Constraint Language
Babelsberg/JS - A Browser-Based Implementation of an Object Constraint Language
复制标题
Babelsberg/JS - 对象约束语言的基于浏览器的实现
DOI:
--
复制
发表时间:
2014
期刊:
影响因子:
--
通讯作者:
R. Krahn
中科院分区:
文献类型:
--
作者:
T. Felgentreff;A. Borning;R. Hirschfeld;Jens Lincke;Y. Ohshima;B. Freudenberg;R. Krahn
�� � � � � � �� � ��� �� � � � � � � � � � � � � � � � � � � � � � � � � � � �� � � � � � � � � � � � � � � � � �� � � � � � � � � � � Constraints provide a useful technique for ensuring that desired properties hold in an application. As a result, they have been used in a wide range of applications, including graphical layout, simulation, scheduling, and problem-solving. We describe the design and implementation of an Object Constraint Programming language, an object-oriented language that cleanly integrates constraints with the underlying language in a way that respects encapsulation and standard object-oriented programming techniques, and that runs in browser-based applications. Prior work on Object Constraint Programming languages has relied on modifying the underlying Virtual Machine, but that is not an option for web-based applications, which have become increasingly prominent. In this paper, we present an approach to implementing Object Constraint Programming without Virtual Machine support, along with an implementation as a JavaScript extension. We demonstrate the resulting language, Babelsberg/JS, on a number of applications and provide performance measurements. Programs without constraints in Babelsberg/JS run at the same speed as pure JavaScript versions, while programs that do have constraints can still be run efficiently. Our design and implementation also incorporate incremental re-solving to support interaction, as well as a cooperating solvers architecture that allows multiple solvers to work together to solve more difficult problems.