Logo PTI Logo FedCSIS

Position Papers of the 17th Conference on Computer Science and Intelligence Systems

Annals of Computer Science and Information Systems, Volume 31

Small Footprint Embedded Systems Paradigm Based on a Novel and Scalable Implementation of FORTH

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 123130 ()

Full text

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.


  1. Brodie L.: Thinking Forth. A Language and Philosophy for Solving Problems, Creative Commons, 2004.
  2. 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.
  3. 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.
  4. Conklin E.K., Rather E. D.: Forth Programmer’s Handbook, FORTH Inc. 2010.
  5. Cyganek B.: Introduction to Programming with C++ for Engineers. Wiley-IEEE Press, 2021.
  6. 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.
  7. https://en.cppreference.com/w/cpp/language/coroutines
  8. Gamma, E.; Helm, R.; Johnson, R.; Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley Professional, 1994.
  9. Knuth D. E. The art of computer programming, Vol. 1: Fundamental algorithms (3rd. ed.), Addison-Wesley, 1997.
  10. Pelc S.: Programming Forth. MicroProcessor Engineering Limited, 2005.
  11. 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.
  12. Rather E. D.: Forth Application Techniques, 6th edition, FORTH Inc. 2019.
  13. https://en.wikipedia.org/wiki/Charles_H._Moore#cite_note-2
  14. https://forth-standard.org/
  15. https://theforth.net/
  16. https://github.com/BogCyg/BCForth
  17. https://en.wikipedia.org/wiki/ESP8266
  18. https://en.wikipedia.org/wiki/NodeMCU
  19. https://en.wikipedia.org/wiki/Forth_(programming_language)
  20. https://gforth.org/
  21. https://www.forth.com/
  22. http://git.annexia.org/?p=jonesforth.git;a=summary
  23. https://awesomeopensource.com/projects/forth
  24. https://cppreference.com