skip to main content
10.1145/3342558.3345397acmconferencesArticle/Chapter ViewAbstractPublication PagesdocengConference Proceedingsconference-collections
research-article

On the Expressive Power of Declarative Constructs in Interactive Document Scripts

Published:23 September 2019Publication History

ABSTRACT

It is difficult to generally compare the succinctness of declarative versus imperative programming as source code size varies. In imperative programs, basic operations have constant cost, but they tend to be more verbose than declarative programs, which increases the potential for defects. This paper presents a novel approach for a generalized comparison by transforming the problem into comparing executed code size of a benchmark imperative algorithm with a partially declarative variant of the same algorithm. This allows input size variation to substitute for source code size variation. For implementation, we use a multiparadigm language called XForms that contains both declarative XPath expressions and imperative script actions for interacting with XML data within web and office documents. A novel partially declarative variant of the quicksort is presented. Amortized analysis shows that only O(n) imperative actions are executed, so the expressive power of the declarative constructs is at least Ω(log n). In general, declarative constructs can have an order of magnitude expressive power advantage compared with only using basic imperative operations. The performance cost factor of the expressive power advantage was determined to be O(log2 n) based on a novel dynamic projection from the generalized tree structure of XML data to a height balanced binary tree.

Skip Supplemental Material Section

Supplemental Material

References

  1. Apache Software Foundation. 2014. The Apache Xalan Project. https://xalan.apache.org/;https://github.com/apache/xalan-jGoogle ScholarGoogle Scholar
  2. Apache Software Foundation. 2019. Apache Open Office. https://openoffice.apache.org/source.htmlGoogle ScholarGoogle Scholar
  3. John M. Boyer. 1998. Sorting and Searching Linked Lists in Java. Dr. Dobb's Journal 285 (May 1998), 126--129 & 137--138. http://www.drdobbs.com/database/algorithm-alley/184410565Google ScholarGoogle Scholar
  4. John M. Boyer (Ed.). 2009. XForms 1.1. W3C Recommendation (20 October 2009). http://www.w3.org/TR/2009/REC-xforms-20091020/Google ScholarGoogle Scholar
  5. John M. Boyer. 2016. Document Order Management via Binary Tree Projection. United States Patent 9411792 (Aug 2016). https://patents.google.com/patent/US9411792B2Google ScholarGoogle Scholar
  6. John M. Boyer. 2019. Multitasking Algorithms in XForms. In Proceedings of Balisage: The Markup Conference 2019 (Balisage Series on Markup Technologies), Vol. 22. Washington, DC, 1--16.Google ScholarGoogle ScholarCross RefCross Ref
  7. John M. Boyer. 2019. XForms Demo of Sorts. https://github.com/john-boyer-phd/XForms/tree/master/Samples/DemoOfSortsGoogle ScholarGoogle Scholar
  8. Tim Bray, Dave Hollander, Andrew Layman, Richard Tobin, and Henry S. Thompson (Eds.). 2009. Namespaces in XML 1.0 (Third Edition). W3C Recommendation (8 December 2009). https://www.w3.org/TR/2009/REC-xml-names-20091208/Google ScholarGoogle Scholar
  9. Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, and François Yergeau (Eds.). 2008. Extensible Markup Language (XML) 1.0 (Fifth Edition). W3C Recommendation (26 November 2008). https://www.w3.org/TR/2008/REC-xml-20081126/Google ScholarGoogle Scholar
  10. Frederick P. Brooks, Jr. 1995. The Mythical Man-month (Anniversary Ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.Google ScholarGoogle Scholar
  11. James Clark (Ed.). 1999. XSL Transformations (XSLT) Version 1.0. W3C Recommendation (16 November 1999). http://www.w3.org/TR/1999/REC-xslt-19991116Google ScholarGoogle Scholar
  12. James Clark and Steve DeRose (Eds.). 1999. XML Path Language (XPath) Version 1.0. W3C Recommendation (16 November 1999). https://www.w3.org/TR/1999/REC-xpath-19991116/Google ScholarGoogle Scholar
  13. Alain Couthures. 2018. XSLTForms. https://sourceforge.net/projects/xsltforms/Google ScholarGoogle Scholar
  14. Patrick Durusau and Michael Brauer (Eds.). 2011. Open Document Format for Office Applications (OpenDcoument) Version 1.2. OASIS Standard (29 September 2011). http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os.htmlGoogle ScholarGoogle Scholar
  15. Steve Faulkner, Arron Eicholz, Travis Leithead, Alex Danilo, and Sangwhan Moon (Eds.). 2017. HTML 5.2. W3C Recommendation (14 December 2017). https://www.w3.org/TR/2017/REC-html52-20171214/Google ScholarGoogle Scholar
  16. International Business Machines Corporation. 2015. IBM Forms 8.2.1. https://ibm.biz/Bd2UgwGoogle ScholarGoogle Scholar
  17. Donald E. Knuth. 1998. The Art of Computer Programming, Volume 3: Sorting and Searching (2nd Ed.). Addison Wesley Longman Publishing Co., Inc., Redwood City, CA, USA.Google ScholarGoogle Scholar
  18. Shane McCarron, Steven Pemberton, and T. V. Raman (Eds.). 2003. XML Events: An Events Syntax for XML. W3C Recommendation (23 October 2003). https://www.w3.org/TR/2003/REC-xml-events-20031014/Google ScholarGoogle Scholar
  19. Mozilla Foundation. 2019. gecko-dev/js/src/builtin/Array.cpp. https://github.com/mozilla/gecko-dev/blob/master/js/src/builtin/Array.cppGoogle ScholarGoogle Scholar
  20. Steven Pemberton. 2018. XForms 2.0: What's New. In Proceedings of Balisage: The Markup Conference 2018 (Balisage Series on Markup Technologies), Vol. 21. Washington, DC. https://doi.org/10.4242/BalisageVol21.Pemberton02Google ScholarGoogle ScholarCross RefCross Ref
  21. Daniel Veillard, Bjorn Reese, William Brack, Igor Zlatkovic, and Aleksey Sanin. 2019. XML Parser and Markup Toolkit. https://github.com/GNOME/libxml2Google ScholarGoogle Scholar
  22. Thomas Vogel, Stefan Neumann, Stephan Hildebrandt, Holger Giese, and Basil Becker. 2010. Incremental Model Synchronization for Efficient Run-Time Monitoring. In Models in Software Engineering, Sudipto Ghosh (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg, 124--139. https://doi.org/10.1007/978-3-642-12261-3_13Google ScholarGoogle Scholar
  23. Wikipedia contributors. 2018. Comparison of Programming Paradigms. https://en.wikipedia.org/wiki/Comparison_of_programming_paradigms [Online; accessed 02-March-2019].Google ScholarGoogle Scholar
  24. Allen Wirfs-Brock (Ed.). 2015. ECMAScript 2015 Language Specification (6th edition). European Computer Manufacturers Association (ECMA) Standard (June 2015). https://www.ecma-international.org/ecma-262/6.0/Google ScholarGoogle Scholar

Index Terms

  1. On the Expressive Power of Declarative Constructs in Interactive Document Scripts

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  DocEng '19: Proceedings of the ACM Symposium on Document Engineering 2019
                  September 2019
                  254 pages
                  ISBN:9781450368872
                  DOI:10.1145/3342558

                  Copyright © 2019 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 23 September 2019

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article
                  • Research
                  • Refereed limited

                  Acceptance Rates

                  DocEng '19 Paper Acceptance Rate30of77submissions,39%Overall Acceptance Rate178of537submissions,33%
                • Article Metrics

                  • Downloads (Last 12 months)6
                  • Downloads (Last 6 weeks)0

                  Other Metrics

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader