This Article 
 Bibliographic References 
 Add to: 
FlowTalk: Language Support for Long-Latency Operations in Embedded Devices
July/August 2011 (vol. 37 no. 4)
pp. 526-543
Alexandre Bergel, University of Chile, Santiago
William Harrison, Software Structure Group
Vinny Cahill, Lero and Trinity College Dublin, Ireland
Siobhán Clarke, Lero and Trinity College Dublin, Ireland
Wireless sensor networks necessitate a programming model different from those used to develop desktop applications. Typically, resources in terms of power and memory are constrained. C is the most common programming language used to develop applications on very small embedded sensor devices. We claim that C does not provide efficient mechanisms to address the implicit asynchronous nature of sensor sampling. C applications for these devices suffer from a disruption in their control flow. In this paper, we present FlowTalk, a new object-oriented programming language aimed at making software development for wireless embedded sensor devices easier. FlowTalk is an object-oriented programming language in which dynamicity (e.g., object creation) has been traded for a reduction in memory consumption. The event model that traditionally comes from using sensors is adapted in FlowTalk with controlled disruption, a light-weight continuation mechanism. The essence of our model is to turn asynchronous long-latency operations into synchronous and blocking method calls. FlowTalk is built for TinyOS and can be used to develop applications that can fit in 4 KB of memory for a large number of wireless sensor devices.

[1] J.R. Andersen, L. Bak, S. Grarup, K.V. Lund, T. Eskildsen, K.M. Hansen, and M. Torgersen, "Design, Implementation, and Evaluation of the Resilient Smalltalk Embedded Platform," Proc. ESUG Int'l Smalltalk Conf. 2004, Sept. 2004.
[2] C. Andreae, Y. Coady, C. Gibbs, J. Noble, J. Vitek, and T. Zhao, "Scoped Types and Aspects for Real-Time Java," Proc. European Conf. Object-Oriented Programming, pp. 124-147, July 2006.
[3] J. Baker, A. Cunei, C. Flack, F. Pizlo, M. Prochazka, J. Vitek, A. Armbuster, E. Pla, and D. Holmes, "A Real-Time Java Virtual Machine for Avionics," Proc. 12th IEEE Real-Time and Embedded Technology and Applications Symp.. 2006.
[4] G. Berry, "The Foundations of Esterel," Proof, Language and Interaction: Essays in Honour of Robin Milner, G. Plotkin, C. Stirling, and M. Tofte, eds., MIT Press, 1998.
[5] S. Bhatti, J. Carlson, H. Dai, J. Deng, J. Rose, A. Sheth, B. Shucker, C. Gruenwald, A. Torgerson, and R. Han, "MANTIS OS: An Embedded Multithreaded Operating System for Wireless Micro Sensor Platforms," Mobile Networks and Applications, vol. 10, no. 4, pp. 563-579, 2005.
[6] E. Brewer, D. Culler, D. Gay, P. Levis, R. von Behren, and M. Welsh, "nesC: A Programming Language for Deeply Networked Systems," http:/, 2004.
[7] D. Caromel, "Programming Abstractions for Concurrent Programming," Proc. TOOLS, pp. 245-253, Nov. 1990.
[8] P. Chandrasekaran, C.L. Conway, J.M. Joy, and S.K. Rajamani, "Programming Asynchronous Layers with Clarity," Proc. Sixth Joint Meeting of the European Software Eng. Conf. and the ACM SIGSOFT Symp. The Foundations of Software Eng., pp. 65-74, 2007.
[9] E. Cheong and J. Liu, "galsc: A Language for Event-Driven Embedded Systems," Proc. Conf. Design, Automation and Test in Europe, pp. 1050-1055, 2005.
[10] M.E. Conway, "Design of a Separable Transition-Diagram Compiler," Comm. ACM, vol. 6, no. 7, pp. 396-408, 1963.
[11] J. Dedecker, T.V. Cutsem, S. Mostinckx, T. D'Hondt, and W.D. Meuter, "Ambient-Oriented Programming in Ambienttalk," Proc. 20th European Conf. Object-Oriented Programming, D. Thomas, ed., pp. 230-254, 2006.
[12] R.P. Draves, B.N. Bershad, R.F. Rashid, and R.W. Dean, "Using Continuations to Implement Thread Management and Communication in Operating Systems," Proc. 13th ACM Symp. Operating Systems Principles, pp. 122-136, 1991.
[13] S. Ducasse, A. Lienhard, and L. Renggli, "Seaside: A Flexible Environment for Building Dynamic Web Applications," IEEE Software, vol. 24, no. 5, pp. 56-63, Sept./Oct. 2007.
[14] S. Ducasse, O. Nierstrasz, N. Schärli, R. Wuyts, and A. Black, "Traits: A Mechanism for Fine-Grained Reuse," ACM Trans. Programming Languages and Systems, vol. 28, no. 2, pp. 331-388, Mar. 2006.
[15] A. Dunkels, O. Schmidt, T. Voigt, and M. Ali, "Protothreads: Simplifying Event-Driven Programming of Memory-Constrained Embedded Systems," Proc. Fourth Int'l Conf. Embedded Networked Sensor Systems, pp. 29-42, 2006.
[16] J. Fischer, R. Majumdar, and T. Millstein, "Tasks: Language Support for Event-Driven Programming," Proc. 2007 ACM SIGPLAN Symp. Partial Evaluation and Semantics-Based Program Manipulation, pp. 134-143, 2007.
[17] D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler, "The nesC Language: A Holistic Approach to Networked Embedded Systems," Proc. ACM SIGPLAN 2003 Conf. Programming Language Design and Implementation, pp. 1-11, 2003.
[18] R. Gummadi, N. Kothari, R. Govindan, and T. Millstein, "Kairos: A Macro-Programming System for Wireless Sensor Networks," Proc. 20th ACM Symp. Operating Systems Principles, pp. 1-2, 2005.
[19] R. Gummadi, N. Kothari, T. Millstein, and R. Govindan, "Declarative Failure Recovery for Sensor Networks," Proc. Sixth Int'l Conf. Aspect-Oriented Software Development, pp. 173-184, 2007.
[20] N. Halbwachs, Synchronous Programming of Reactive Systems. Kluwer Academic Publishers, 1992.
[21] P. Haller and M. Odersky, "Event-Based Programming without Inversion of Control," Proc. Join Modular Programming Languages, pp. 4-22, Sept. 2006.
[22] M. Karpinski and V. Cahill, "High-Level Application Development is Realistic for Wireless Sensor Network," Proc. Fourth Ann. IEEE Comm. Soc. Conf. Sensor, Mesh and Ad Hoc Comm. and Networks, pp. 610-619, June 2007.
[23] B. Kernighan and D. Ritchie, The C Programming Language. Prentice Hall, 1978.
[24] N. Kothari, R. Gummadi, T. Millstein, and R. Govindan, "Reliable and Efficient Programming Abstractions for Wireless Sensor Networks," Proc. 2007 ACM SIGPLAN Conf. Programming Language Design and Implementation, pp. 200-210, 2007.
[25] S. Krishnamurthi, Programming Languages: Application and Interpretation. Shriram Krishnamurthi, 2007.
[26] P. Levis and D. Culler, "Maté: A Tiny Virtual Machine for Sensor Networks," Proc. 10th Int'l Conf. Architectural Support for Programming Languages and Operating Systems, pp. 85-95, 2002.
[27] A. Mainwaring, D. Culler, J. Polastre, R. Szewczyk, and J. Anderson, "Wireless Sensor Networks for Habitat Monitoring," Proc. First ACM Int'l Workshop Wireless Sensor Networks and Applications, pp. 88-97, 2002.
[28] K. Matheus, R. Morich, C. Menig, A. Lübke, B. Rech, and W. Specks, "Car-to-Car Communication—Market Introduction and Success Factors," Proc. Fifth European Congress and Exhibition on Intelligent Transport Systems and Services, 2005.
[29] J. Matthews, R.B. Findler, P. Graunke, S. Krishnamurthi, and M. Felleisen, "Automatically Restructuring Programs for the Web," Automated Software Eng., vol. 11, no. 4, pp. 337-364, 2003.
[30] J.C.B. Mattos, E. Specht, B. Neves, and L. Carro, "Making Object Oriented Efficient for Embedded System Applications," Proc. 18th Ann. Symp. Integrated Circuits and System Design, pp. 104-109, 2005.
[31] Y. Ni, U. Kremer, A. Stere, and L. Iftode, "Programming Ad-Hoc Networks of Mobile and Resource-Constrained Devices," ACM SIGPLAN Notice, vol. 40, no. 6, pp. 249-260, 2005.
[32] O. Nierstrasz, G. Arévalo, S. Ducasse, R. Wuyts, A. Black, P. Müller, C. Zeidler, T. Genssler, and R.V.D. Born, "A Component Model for Field Devices," Proc. First Int'l IFIP/ACM Working Conf. Component Deployment, pp. 200-209, June 2002.
[33] J. Noble and C. Weir, Small Memory Software: Patterns for Systems with Limited Memory. Addison-Wesley Professional, Nov. 2000.
[34] J. Nordlander, "Reactive Objects and Functional Programming," PhD thesis, Chalmers Univ. of Technology, Götebord, Sweden, May 1999.
[35] J. Nordlander, M.P. Jones, M. Carlsson, R.B. Kieburtz, and A. Black, "Reactive Objects," Proc. Fifth IEEE Int'l Symp. Object-Oriented Real-Time Distributed Computing, pp. iii-x, Apr. 2002.
[36] C. Queinnec, "Inverting Back the Inversion of Control or, Continuations versus Page-Centric Programming," ACM SIGPLAN Notice, vol. 38, no. 2, pp. 57-64, 2003.
[37] U.P. Schultz, K. Burgaard, F.G. Christensen, and J.L. Knudsen, "Compiling Java for Low-End Embedded Systems," ACM SIGPLAN Notice, vol. 38, no. 7, pp. 42-50, 2003.
[38] D. Simon, C. Cifuentes, D. Cleal, J. Daniels, and D. White, "Java on the Bare Metal of Wireless Sensor Devices: The Squawk Java Virtual Machine," Proc. Second Int'l Conf. Virtual Execution Environments, pp. 78-88, 2006.
[39] TinyOS: An Open-Source OS for the Networked Sensor Regime, http:/, 2010.
[40] B.L. Titzer, "Virgil: Objects on the Head of a Pin," Proc. 21st Ann. ACM SIGPLAN Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 191-208, 2006.
[41] B.A. Warneke and K.S. Pister, "Exploring the Limits of System Integration with Smart Dust," Proc. ASME Int'l Mechanical Eng. Congreee and Exposition, pp. 17-22, Nov. 2002.
[42] O. Zendra, "Memory and Compiler Optimizations for Low-Power and -Energy," Proc. Workshop Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems, July 2006.
[43] Y. Zhang and R. Gupta, "Data Compression Transformations for Dynamically Allocated Data Structures," Proc. 11th Int'l Conf. Compiler Construction, pp. 14-28, 2002.
[44] T. Zhao, J. Noble, and J. Vitek, "Scoped Types for Real-Time Java," Proc. 25th IEEE Int'l Real-Time Systems Symp., pp. 241-251, 2004.

Index Terms:
Embedded systems, object-based programming.
Alexandre Bergel, William Harrison, Vinny Cahill, Siobhán Clarke, "FlowTalk: Language Support for Long-Latency Operations in Embedded Devices," IEEE Transactions on Software Engineering, vol. 37, no. 4, pp. 526-543, July-Aug. 2011, doi:10.1109/TSE.2010.66
Usage of this product signifies your acceptance of the Terms of Use.