skip to main content
10.1145/3359619.3359748acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article

Standard object out: streaming objects with polymorphic write streams

Published: 20 October 2019 Publication History

Abstract

We propose standard object out, an object-oriented analog to the output part of the Unix standard input output library.
Polymorphic Write Streams (PWS) act as architectural adapters between the object-oriented architectural style and the pipes and filters architectural style in the same way that stdio acts as an architectural adapter between the call/return architectural style and the pipes and filters architectural style.
Current object-oriented interfaces to the Unix I/O system mimic their procedural counterparts so closely that they manage to be neither polymorphic nor streaming, at least not for objects. Specifically the object is first converted to a fixed byte-representation by sending it a specific message and the result is then output on the underlying byte stream.
With this approach, these APIs do not allow for streaming behaviour: the entire result has to be constructed in-memory before it can be output. In addition, output of nested structures can require large multiples of time and space compared to the final output size, and fails completely if there are cycles in the object graph. It also does not allow for polymorphic behaviour.
To solve these problems, we propose Polymorphic Write-Streams (PWS). PWSs represent a hierarchy of classes that decouple encoding from specific streaming destinations. Using triple dispatch they provide streaming behaviour and allow each stream to react specifically to each kind of object and vice versa: sharing of common functionality is enabled by chaining messages along the streams’ inheritance chain.

References

[1]
1994. fwrite(3) BSD Library Functions Manual.
[2]
2001. PDF Reference: Adobe Portable Document Format Version 1.4 with Cdrom (3rd ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[3]
2009. printf(3) BSD Library Functions Manual.
[4]
2012. NeXT Property Lists. https://en.wikipedia.org/wiki/Property_list.
[5]
2013. Standard for Information Technology--Portable Operating System Interface (POSIX(R)) Base Specifications, Issue 7. IEEE Std 1003.1, 2013 Edition (incorporates IEEE Std 1003.1-2008, and IEEE Std 1003.1- 2008/Cor 1-2013) (April 2013), 1-3906.
[6]
Apple Inc. 2009. Cocoa Reference. http://developer.apple.com/docs/Cocoa/.
[7]
Hans-J. Boehm, Russ Atkinson, and Michael Plass. 1995. Ropes: An Alternative to Strings. Softw. Pract. Exper. 25, 12 (Dec. 1995), 1315-1330.
[8]
S. R. Bourne. 1978. UNIX Time-Sharing System: The UNIX Shell. Bell System Technical Journal 57, 6 (1978), 1971- 1990. arXiv:https://onlinelibrary.wiley.com/doi/pdf/10.1002/j.1538-7305.1978.tb02139.x.
[9]
Hristo Deshev. 2008. Pro Windows PowerShell (Pro). APress.
[10]
Richard P. Gabriel, Jon L. White, and Daniel G. Bobrow. 1991. CLOS: Integrating Object-oriented and Functional Programming. Commun. ACM 34, 9 (Sept. 1991), 29-38.
[11]
James Gosling, Bill Joy, and Guy L. Steele. 1996. The Java Language Specification (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[12]
Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay. 1997. Back to the Future: The Story of Squeak, a Practical Smalltalk Written in Itself. SIGPLAN Not. 32, 10 (Oct. 1997), 318-326.
[13]
Daniel H. H. Ingalls. 1986. A Simple Technique for Handling Multiple Polymorphism. SIGPLAN Not. 21, 11 (June 1986), 347-349.
[14]
David Korn and Kiem phong Vo. 1991. SFIO: Safe/Fast String/File IO. In In Proc. of the Summer '91 Usenix Conference. 235-256.
[15]
Angelika Langer and Klaus Kreft. 2008. Standard C++ IOStreams and Locales: Advanced Programmer's Guide and Reference (1st ed.). Addison-Wesley Professional.
[16]
Doug McIlroy. 1964. Pipes Proposal. http://doc.cat-v.org/unix/pipes/.
[17]
Scott McKay. 1991. CLIM: The Common Lisp Interface Manager. Commun. ACM 34, 9 (Sept. 1991), 58-59.
[18]
Adobe Press. 1985. PostScript Language Reference Manual (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[19]
Mary Shaw and David Garlan. 1996. Software Architecture: Perspectives on an Emerging Discipline. Prentice-Hall, Inc., Upper Saddle River, NJ, USA.
[20]
Bjarne Stroustrup. 2000. The C++ Programming Language (3rd ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[21]
R. N. Taylor, N. Medvidovic, and E. M. Dashofy. 2009. Software Architecture: Foundations, Theory, and Practice. Wiley Publishing.
[22]
Guido van Rossum and Fred L. Drake. 2011. The Python Language Reference Manual. Network Theory Ltd.
[23]
Marcel Weiher. 1998. MPWFoundation Framework. https://github.com/mpw/MPWFoundation.
[24]
Marcel Weiher. 2003. Objective-Smalltalk. http://objective.st.
[25]
Marcel Weiher. 2003. stsh. http://objective.st/Scripting.
[26]
Marcel Weiher. 2017. iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift. Addison-Wesley Professional.
[27]
Nobuyoshi Nakada et al. Yukihiro Matsumoto, Koichi Sasada. [n. d.]. MRI - Matz's Ruby Interpreter - The Ruby Programming Language. https://www.ruby-lang.org/en/.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
DLS 2019: Proceedings of the 15th ACM SIGPLAN International Symposium on Dynamic Languages
October 2019
116 pages
ISBN:9781450369961
DOI:10.1145/3359619
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 the author(s) 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

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 October 2019

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Unix
  2. adapter
  3. architecture
  4. filters
  5. objects
  6. pipes
  7. stdio

Qualifiers

  • Research-article

Conference

SPLASH '19
Sponsor:

Acceptance Rates

Overall Acceptance Rate 32 of 77 submissions, 42%

Upcoming Conference

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 96
    Total Downloads
  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)2
Reflects downloads up to 09 Sep 2024

Other Metrics

Citations

Cited By

View all

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media