Small Footprint Embedded Systems Paradigm Based on a Novel and Scalable Implementation of FORTH
Bogusław Cyganek
DOI: http://dx.doi.org/10.15439/2022F275
Citation: Position Papers of the 17th Conference on Computer Science and Intelligence Systems, M. Ganzha, L. Maciaszek, M. Paprzycki, D. Ślęzak (eds). ACSIS, Vol. 31, pages 123–130 (2022)
Abstract. This paper describes architecture of the novel implementation of the Forth interpreter-compiler. The architecture follows the object- and component-oriented design paradigms. The implementation is done with the modern C++ 20 language taking full advantage of such constructs as lambda functions, variadic templates, as well as the coroutines and concepts. The system is highly modular and easily scales for small footprint embedded systems. We propose to extend Forth with the coroutine words that allow for async operations and lightweight cooperative multi-threading. We show successful deployment of the proposed Forth implementation on three platforms, two PC frameworks running Linux and Windows, respectively, as well as on tiny embedded system NodeMCU v3 with the 32-bit RISC ESP8266 microprocessor and 32/80KB memory. The project has also educational value, showing intrinsic operation of Forth and modern C++. Software is available free from the Internet.
References
- Brodie L.: Thinking Forth. A Language and Philosophy for Solving Problems, Creative Commons, 2004.
- Belson B., W. Xiang, J. Holdsworth and B. Philippa, C++20 Coroutines on Microcontrollers – What We Learned, IEEE Embedded Systems Letters, vol. 13, no. 1, pp. 9-12, 2021.
- Belson B., et al.. A Survey of Asynchronous Programming Using Coroutines in the Internet of Things and Embedded Systems. ACM Trans. Embed. Comput. Syst. 18/3, 2019.
- Conklin E.K., Rather E. D.: Forth Programmer’s Handbook, FORTH Inc. 2010.
- Cyganek B.: Introduction to Programming with C++ for Engineers. Wiley-IEEE Press, 2021.
- Dunkels A., Schmidt O., Voigt T., Muneeb A. Protothreads: simplifying event-driven programming of memory-constrained embedded systems. 4th international conference on Embedded networked sensor systems (SenSys '06). ACM, 29–42, 2006.
- https://en.cppreference.com/w/cpp/language/coroutines
- Gamma, E.; Helm, R.; Johnson, R.; Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley Professional, 1994.
- Knuth D. E. The art of computer programming, Vol. 1: Fundamental algorithms (3rd. ed.), Addison-Wesley, 1997.
- Pelc S.: Programming Forth. MicroProcessor Engineering Limited, 2005.
- Rather E. D., Colburn Donald R., and Moore Charles H.: The evolution of Forth. History of programming languages-II. Assoc. for Comp. Machinery, New York, USA, 625–670, 1996.
- Rather E. D.: Forth Application Techniques, 6th edition, FORTH Inc. 2019.
- https://en.wikipedia.org/wiki/Charles_H._Moore#cite_note-2
- https://forth-standard.org/
- https://theforth.net/
- https://github.com/BogCyg/BCForth
- https://en.wikipedia.org/wiki/ESP8266
- https://en.wikipedia.org/wiki/NodeMCU
- https://en.wikipedia.org/wiki/Forth_(programming_language)
- https://gforth.org/
- https://www.forth.com/
- http://git.annexia.org/?p=jonesforth.git;a=summary
- https://awesomeopensource.com/projects/forth
- https://cppreference.com