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 2019 Publication 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.

Supplementary Material

boyer (boyer.zip)
Supplemental movie, appendix, image and software files for, On the Expressive Power of Declarative Constructs in Interactive Document Scripts

References

[1]
Apache Software Foundation. 2014. The Apache Xalan Project. https://xalan.apache.org/;https://github.com/apache/xalan-j
[2]
Apache Software Foundation. 2019. Apache Open Office. https://openoffice.apache.org/source.html
[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/184410565
[4]
John M. Boyer (Ed.). 2009. XForms 1.1. W3C Recommendation (20 October 2009). http://www.w3.org/TR/2009/REC-xforms-20091020/
[5]
John M. Boyer. 2016. Document Order Management via Binary Tree Projection. United States Patent 9411792 (Aug 2016). https://patents.google.com/patent/US9411792B2
[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.
[7]
John M. Boyer. 2019. XForms Demo of Sorts. https://github.com/john-boyer-phd/XForms/tree/master/Samples/DemoOfSorts
[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/
[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/
[10]
Frederick P. Brooks, Jr. 1995. The Mythical Man-month (Anniversary Ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[11]
James Clark (Ed.). 1999. XSL Transformations (XSLT) Version 1.0. W3C Recommendation (16 November 1999). http://www.w3.org/TR/1999/REC-xslt-19991116
[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/
[13]
Alain Couthures. 2018. XSLTForms. https://sourceforge.net/projects/xsltforms/
[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.html
[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/
[16]
International Business Machines Corporation. 2015. IBM Forms 8.2.1. https://ibm.biz/Bd2Ugw
[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.
[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/
[19]
Mozilla Foundation. 2019. gecko-dev/js/src/builtin/Array.cpp. https://github.com/mozilla/gecko-dev/blob/master/js/src/builtin/Array.cpp
[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.Pemberton02
[21]
Daniel Veillard, Bjorn Reese, William Brack, Igor Zlatkovic, and Aleksey Sanin. 2019. XML Parser and Markup Toolkit. https://github.com/GNOME/libxml2
[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_13
[23]
Wikipedia contributors. 2018. Comparison of Programming Paradigms. https://en.wikipedia.org/wiki/Comparison_of_programming_paradigms [Online; accessed 02-March-2019].
[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/

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 23 September 2019

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Algorithm analysis
  2. Document models and structures
  3. Document representation and standards
  4. Interactive documents
  5. Multiparadigm languages
  6. Rich web applications

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

DocEng '19
Sponsor:
DocEng '19: ACM Symposium on Document Engineering 2019
September 23 - 26, 2019
Berlin, Germany

Acceptance Rates

DocEng '19 Paper Acceptance Rate 30 of 77 submissions, 39%;
Overall Acceptance Rate 194 of 564 submissions, 34%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 102
    Total Downloads
  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 03 Mar 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media