skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Reusable

Super 8 languages for making movies (functional pearl)

Published:29 August 2017Publication History
Skip Abstract Section

Abstract

The Racket doctrine tells developers to narrow the gap between the terminology of a problem domain and general programming constructs by creating languages instead of just plain programs. This pearl illustrates this point with the creation of a relatively simple domain-specific language for editing videos. To produce the video proceedings of a conference, for example, video professionals traditionally use "non-linear" GUI editors to manually edit each talk, despite the repetitive nature of the process. As it turns out, video editing naturally splits the work into a declarative phase and an imperative rendering phase at the end. Hence it is natural to create a functional-declarative language for the first phase, which reduces a lot of manual labor. This user-facing DSL utilizes a second, internal DSL to implement the second phase, which is an interface to a general, low-level C library. Finally, we inject type checking into our language via another DSL that supports programming in the language of type formalisms. In short, the development of the video editing language cleanly demonstrates how the Racket doctrine naturally leads to the creation of language hierarchies, analogous to the hierarchies of modules found in conventional functional languages.

Skip Supplemental Material Section

Supplemental Material

References

  1. Eli Barzilay and John Clements. Laziness Without All the Hard Work. In Functional and Declarative Programming in Education, pp. 9–13, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Eli Barzilay and Dimitry Orlovsky. Foreign Interface for PLT Scheme. In Scheme and Functional Programming, pp. 63–74, 2004.Google ScholarGoogle Scholar
  3. Alan Bawden and Jonathan Rees. Syntactic Closures. In Lisp and Functional Programming, pp. 86–95, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Jon Bentley. Little Languages. Communications of the ACM 29(8), pp. 711–21, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Dick Bulterman, Jack Jansen, Pablo Cesar, Sjoerd Mullender, Eric Hyche, Marisa DeMeglio, Julien Quint, Hiroshi Kawamura, Daniel Weck, Xabiel García Pañeda, David Melendi, Samuel Cruz-Lara, Marcin Hanclik, Daniel F. Zucker, and Thierry Michel. Synchronized Multimedia Integration Language. World Wide Web Consortium (W3C), 3.0, 2008. https://www.w3.org/TR/2008/REC-SMIL3-20081201/Google ScholarGoogle Scholar
  6. Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. Finally Tagless, Partially Evaluated. Journal of Functional Programming 19(5), pp. 509–543, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Stephen Chang, Alex Knauth, and Ben Greenman. Type Systems as Macros. In Principles of Programming Languages, pp. 694–705, 2017.Google ScholarGoogle Scholar
  8. William Clinger. Hygienic Macros Through Explicit Renaming. Lisp Pointers IV(4), pp. 25–28, 1991.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. William R. Cook. Applescript. In History of Programming Languages, pp. 1-1–1-21, 2007.Google ScholarGoogle Scholar
  10. Ryan Culpepper. Fortifying Macros. Journal of Functional Programming 22(4-5), pp. 439–476, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Ryan Culpepper and Matthias Felleisen. Debugging Hygienic Macros. Science of Computer Programming 75(7), pp. 496–515, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Ken Dancyger. The Technique of Film and Video Editing: History, Theory, and Practice. Fifth edition. Focal Press, 2010.Google ScholarGoogle Scholar
  13. Sergey Dmitriev. Language Oriented Programming: The Next Programming Paradigm. JetBrains onBoard Electronic Magazine 1(1), 2004.Google ScholarGoogle Scholar
  14. R. Kent Dybvig, Robert Hieb, and Carl Bruggeman. Syntactic Abstraction in Scheme. Lisp and Symbolic Computation 5(4), pp. 295–326, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Sebastian Erdweg, Tillmann Rendel, Christian Kästner, and Klaus Ostermann. SugarJ: Library-based Syntactic Language Extensibility. In Object Oriented Programming Systems, Languages, and Applications, pp. 391–406, 2011.Google ScholarGoogle Scholar
  16. Sebastian Erdweg, Tijs van der Storm, Markus Völter, Laurence Tratt, Remi Bosman, William R. Cook, Albert Gerritsen, Angelo Hulshout, Steven Kelly, Alex Loh, Gabriël Konat, Pedro J. Molina, Martin Palatnik, Risto Pohjonen, Eugen Schindler, Klemens Schindler, Riccardo Solmi, Vlad Vergu, Eelco Visser, Kevin van der Vlist, Guido Wachsmuth, and Jimi van der Woning. Evaluating and Comparing Language Workbenches: Existing Results and Benchmarks for the Future. Computer Languages, Systems and Structures 44(Part A), pp. 24–47, 2015.Google ScholarGoogle Scholar
  17. Matthias Felleisen, Robert Bruce Findler, Matthew Flatt, Shriram Krishnamurthi, Eli Barzilay, Jay McCarthy, and Sam Tobin-Hochstadt. The Racket Manifesto. In Summit on Advances in Programming Languages, pp. 113–128, 2015.Google ScholarGoogle Scholar
  18. Daniel Feltey, Spencer P. Florence, Tim Knutson, Vincent St-Amour, Ryan Culpepper, Matthew Flatt, Robert Bruce Findler, and Matthias Felleisen. Languages the Racket Way. In Language Workbench Challenge, 2016.Google ScholarGoogle Scholar
  19. Robert Bruce Findler, John Clements, Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Paul Steckler, and Matthias Felleisen. DrScheme: A Programming Environment for Scheme. Journal of Functional Programming 12(2), pp. 159–182, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Robert Bruce Findler and Matthias Felleisen. Contracts for Higher-order Functions. In International Conference on Functional Programming, pp. 48–59, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Matthew Flatt. Composable and Compilable Macros, You Want It When? In International Conference on Functional Programming, pp. 72–83, 2002.Google ScholarGoogle Scholar
  22. Matthew Flatt. Creating Languages in Racket. Communications of the ACM 55(1), pp. 48–56, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Matthew Flatt, Eli Barzilay, and Robert Bruce Findler. Scribble: Closing the Book on Ad Hoc Documentation Tools. In International Conference on Functional Programming, pp. 109–120, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Matthew Flatt, Robert Bruce Findler, and John Clements. GUI: Racket Graphics Toolkit. PLT Design Inc., PLT-TR-2010-3, 2010. https://racket-lang.org/tr3/Google ScholarGoogle Scholar
  25. Martin Fowler and Rebecca Parsons. Domain-specific Languages. Addison-Wesley, 2010.Google ScholarGoogle Scholar
  26. Jeremy Gibbons and Nicolas Wu. Folding Domain-specific Languages: Deep and Ahallow Embeddings (Functional Pearl). In International Conference on Functional Programming, pp. 339–347, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Gabriel Gonzalez. Light-weight and Type-safe Scripting with Haskell. In Commercial Users of Functional Programming Tutorials, 2015.Google ScholarGoogle Scholar
  28. Paul Hudak. Building Domain-Specific Embedded Languages. ACM Computing Surveys 28(4es), 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Maxim Jago and Adobe Creative Team. Adobe Premiere Pro CC Classroom in a Book. Adobe Press, 2017.Google ScholarGoogle Scholar
  30. Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Geoffrey Washburn. Simple Unificationbased Type Inference for GADTs. In International Conference on Functional Programming, pp. 50–61, 2006.Google ScholarGoogle Scholar
  31. Lennart C.L. Kats and Eelco Visser. The Spoofax Language Workbench: Rules for Declarative Specification of Languages and IDEs. In Object Oriented Programming Systems, Languages, and Applications, pp. 444–463, 2010.Google ScholarGoogle Scholar
  32. Steven Kelly, Kalle Lyytinen, and Matti Rossi. MetaEdit+: A Fully Configurable Multi-User and Multi-Tool CASE and CAME Environment. In Conference on Advances Information System Engineering, pp. 1–21, 1996. Google ScholarGoogle ScholarCross RefCross Ref
  33. Eugene Kohlbecker, Daniel P. Friedman, Matthias Felleisen, and Bruce Duba. Hygienic Macro Expansion. In Lisp and Functional Programming, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Eugene Kohlbecker and Mitchell Wand. Macro-by-example: Deriving Syntactic Transformations From Their Specifications. In Principles of Programming Languages, pp. 77–84, 1987.Google ScholarGoogle Scholar
  35. Shriram Krishnamurthi. Linguistic Reuse. PhD dissertation, Rice University, 2001.Google ScholarGoogle Scholar
  36. Erik Meijer. Server Side Web Scripting in Haskell. Journal of Functional Programming 10(1), pp. 1–18, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Daniel Patterson and Amal Ahmed. Linking Types for Multi-Language Software: Have Your Cake and Eat It Too. In Summit on Advances in Programming Languages, pp. 12-1–12-15, 2017.Google ScholarGoogle Scholar
  38. Eric S. Raymond. The Art of UNIX Programming. First edition. Addison-Wesley, 2003.Google ScholarGoogle Scholar
  39. Ton Roosendaal and Roland Hess. The Essential Blender: Guide to 3D Creation with the Open Source Suite Blender. No Starch Press, 2007.Google ScholarGoogle Scholar
  40. Wim Taymans, Steve Baker, Andy Wingo, Rondald S. Bultje, and Kost Stefan. GStreamer Application Development Manual. 2013. https://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/manual.pdfGoogle ScholarGoogle Scholar
  41. Sam Tobin-Hochstadt, Vincent St-Amour, Ryan Culpepper, Matthew Flatt, and Matthias Felleisen. Languages As Libraries. In Programming Languages Design and Implementation, pp. 132–141, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Martin P. Ward. Language Oriented Programming. Software—Concepts and Tools 15, pp. 147–161, 1994.Google ScholarGoogle Scholar
  43. Hongwei Xi, Chiyan Chen, and Gang Chen. Guarded Recursive Datatype Constructors. In Principles of Programming Languages, pp. 224–235, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Hongwei Xi and Frank Pfenning. Eliminating Array Bound Checking Through Dependent Types. In Programming Languages Design and Implementation, pp. 249–257, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Super 8 languages for making movies (functional pearl)

                  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

                  Full Access

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader