Abstract
iTasks is a shallowly embedded monadic domain-specific language written in the lazy, functional programming language Clean. It implements the Task-Oriented Programming (TOP) paradigm. In TOP one describes, on a high level of abstraction, the tasks that distributed collaborative systems and end users have to do. It results in a web application that is able to coordinate the work thus described. Even though iTasks is defined in the common notion of “tasks”, for stake holders without programming experience, textual source code remains too difficult to understand. In previous work, we introduced Tonic (Task-Oriented Notation Inferred from Code) to graphically represent iTasks programs using blueprints. Blueprints are designed to bridge the gap between domain-expert and programmer. In this paper, we add the capability to graphically trace the dynamic behaviour of an iTasks program at run-time. This enables domain experts, managers, end users and programmers to follow and inspect the work as it is being executed. Using dynamic blueprints we can show, in real-time, who is working on what, which tasks are finished, which tasks are active, and what their parameters and results are. Under certain conditions we can predict which future tasks are reachable and which not. In a way, we have created a graphical tracing and debugging system for the TOP domain and have created the foundation for a tracing and debugging system for monads in general. Tracing and debugging is known to be hard to realize for lazy functional languages. In monadic contexts, however, the order of evaluation is well-defined, reducing the challenges Tonic needs to overcome.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Available in the latest development releases at https://clean.cs.ru.nl/Download_Clean.
- 2.
All blueprints in this paper are generated from the example programs.
- 3.
Clean does not have -notation, so binds are explicitly written out.
- 4.
Cloogle resides at https://cloogle.org/.
References
Achten, P., Stutterheim, J., Domoszlai, L., Plasmeijer, R.: Task oriented programming with purely compositional interactive scalable vector graphics. In: Tobin-Hochstadt, S. (ed.) Proceedings of the 26Nd 2014 International Symposium on Implementation and Application of Functional Languages, IFL 2014, pp. 7:1–7:13. ACM, New York (2014). https://doi.org/10.1145/2746325.2746329
Andy, G.: Debugging haskell by observing intermediate data structures. Electron. Notes Theor. Comput. Sci. 41(1), 1 (2001). http://www.sciencedirect.com/science/article/pii/S1571066105805389
Arisholm, E., Briand, L.C., Hove, S.E., Labiche, Y.: The impact of UML documentation on software maintenance: an experimental evaluation. IEEE Trans. Softw. Eng. 32(6), 365–381 (2006). http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&arnumber=1650213&contentType=Journals+
Henrix, J., Plasmeijer, R., Achten, P.: GiN: a graphical language and tool for defining iTask workflows. In: Peña, R., Page, R. (eds.) TFP 2011. LNCS, vol. 7193, pp. 163–178. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32037-8_11
Nilsson, H.: Information: declarative debugging for lazy functional languages (1998). http://books.google.nl/books?id=nQQ9AAAACAAJ&dq=intitle:Declarative+Debugging+for+Lazy+Functional+Languages&hl=&cd=1&source=gbs_api. Science, U.i.L.D.o.C
Nilsson, H., Sparud, J.: The evaluation dependence tree as a basis for lazy functional debugging. Autom. Softw. Eng. 4(2), 121–150 (1997). http://link.springer.com/10.1023/A:1008681016679
Object Management Group: Business process model and notation (BPMN) version 1.2. Technical report, Object Management Group (2009)
Object Modeling Group: OMG unified modeling language specification. Technical report, March 2000. http://www.omg.org/spec/UML/1.3/PDF/index.htm
Object Modeling Group: OMG unified modeling language (OMG UML), infrastructure. Technical report, March 2012. http://www.omg.org/spec/UML/2.4.1/Infrastructure/PDF/
OMG: OMG unified modeling language (OMG UML), superstructure, Version 2.4.1, August 2011. http://www.omg.org/spec/UML/2.4.1
Plasmeijer, R., Achten, P., Koopman, P., Lijnse, B., Van Noort, T., Van Groningen, J.: iTasks for a change: type-safe run-time change in dynamically evolving workflows. In: PEPM ’11: Proceedings Workshop on Partial Evaluation and Program Manipulation, PEPM 2011, Austin, TX, USA, pp. 151–160. ACM, New York (2011)
Plasmeijer, R., van Eekelen, M.: Clean language report (version 2.1) (2002). http://clean.cs.ru.nl
Poswig, J., Vrankar, G., Morara, C.: VisaVis: a higher-order functional visual programming language. J. Vis. Lang. Comput. 5(1), 83–111 (1994). http://linkinghub.elsevier.com/retrieve/pii/S1045926X84710056
Reekie, H.J.: Visual haskell: a first attempt. Technical report (1994). http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.56.1582&rep=rep1&type=pdf
Reinke, C.: GHood–graphical visualisation and animation of Haskell object observations. In: 2001 ACM SIGPLAN (2001). http://www.haskell.org/haskell-workshop/2001/proceedings.pdf#page=127
Sparud, J., Runciman, C.: Tracing lazy functional computations using redex trails. In: Glaser, H., Hartel, P., Kuchen, H. (eds.) PLILP 1997. LNCS, vol. 1292, pp. 291–308. Springer, Heidelberg (1997). https://doi.org/10.1007/BFb0033851
Sparud, J., Runciman, C.: Complete and partial redex trails of functional computations. In: Clack, C., Hammond, K., Davie, T. (eds.) IFL 1997. LNCS, vol. 1467, pp. 160–177. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0055430
Stutterheim, J., Plasmeijer, R., Achten, P.: Tonic: an infrastructure to graphically represent the definition and behaviour of tasks. In: Hage, J., McCarthy, J. (eds.) TFP 2014. LNCS, vol. 8843, pp. 122–141. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-14675-1_8
White, S.A.: Business process model and notation, V1.1 pp. 1–318, January 2008. http://www.omg.org/spec/BPMN/1.1/PDF/
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Appendices
A Using Tonic
In this section we will look at how to use Tonic in iTasks programs. Tonic consists of two parts: the Tonic compiler and the Tonic framework. iTasks ships with pre-configured Tonic environment files, which you can load into the Clean IDE. The Tonic environment then ensures the correct compiler is used.
Tonic uses an opt-in mechanism to determine which modules to visualize. Opting a module in is done by importing the iTasks._Framework.Tonic module. By default, importing this module will import instances for the Contained and Blueprint type classes for the following types: Task, Maybe, Either, and IO. At this point, you can also define your own instances for these classes.
In order to see the blueprints, you still need to include a path to the built-in Tonic viewer. This is done in the startEngine rule of your program, as shown in Fig. 33. The built-in Tonic viewer is exported via another module, which will need to be imported first.
Navigating to the /tonic URL presents the user with a screen similar to Fig. 34. Two tabs on the top of the screen allow the user to choose between viewing static or dynamic blueprints. Initially, the “Static Blueprints” tab is selected. The user can browse the static blueprints by first selecting the module for which to view the blueprints. After selecting the module, a list with the task names for which a blueprint has been generated appears. Selecting a task name from that list will cause the corresponding blueprint to be rendered.
To view runtime progress, the user can select the “Dynamic Blueprints” tab. This is shown in Sect. 4.5, Fig. 28.
B iTasks Combinators
In this appendix we list common task combinators. All of the combinators used in this paper are presented here. Additional combinators are presented as well. We encourage the reader to experiment with them. Because the iTasks system is a work in progress, it is inevitable that definitions may change in the future. Please use the dedicated search engine CloogleFootnote 4 to get access to up-to-date definitions and documentation, not only of iTasks but also of Clean and all other libraries.
1.1 B.1 Type Classes
1.2 B.2 Step Combinator and Utility Functions
1.3 B.3 Parallel Combinators
1.4 B.4 Editors
1.5 B.5 Share Combinators
1.6 B.6 Task Assignment
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Stutterheim, J., Achten, P., Plasmeijer, R. (2019). Static and Dynamic Visualisations of Monadic Programs. In: Zsók, V., Porkoláb, Z., Horváth, Z. (eds) Central European Functional Programming School. CEFP 2015. Lecture Notes in Computer Science(), vol 10094. Springer, Cham. https://doi.org/10.1007/978-3-030-28346-9_9
Download citation
DOI: https://doi.org/10.1007/978-3-030-28346-9_9
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-28345-2
Online ISBN: 978-3-030-28346-9
eBook Packages: Computer ScienceComputer Science (R0)