Skip to main content

The Design, Evolution, and Use of KernelF

An Extensible and Embeddable Functional Language

  • Conference paper
  • First Online:
Book cover Theory and Practice of Model Transformation (ICMT 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 10888))

Abstract

KernelF is a functional language built on top of MPS. It is designed to be highly extensible and embeddable in order to support its use at the core of domain-specific languages, realising an approach we sometimes call Funclerative Programming. “Funclerative” is of course a mash-up of “functional” and “declarative” and refers to the idea of using functional programming in the small, and declarative language constructs for the larger-scale, often domain-specific, structures in a program. We have used KernelF in a wide range of languages including health and medicine, insurance contract definition, security analysis, salary calculations, smart contracts and language-definition. In this paper, I illustrate the evolution of KernelF over the last two years. I discuss requirements on the language, and how those drove design decisions. I showcase a couple of the DSLs we built on top of KernelF to explain how MPS was used to enable the necessary language modularity. I demonstrate how we have integrated the Z3 solver to verify some aspects of programs. I present the architecture we have used to use KernelF-based DSLs in safety-critical environments. I close the keynote with an outlook on how KernelF might evolve in the future, and point out a few challenges for which we don’t yet have good solutions.

M. Voelter—Independent/itemis.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    ‘We’ refers to the team of languages engineers at itemis Stuttgart.

  2. 2.

    https://www.jetbrains.com/mps/.

  3. 3.

    http://convecton.io.

  4. 4.

    https://languageengineering.io/thoughts-on-declarativeness-fc4cfd4f1832.

  5. 5.

    http://solidity.readthedocs.io/.

  6. 6.

    https://www.artificiallawyer.com/2018/01/19/welcome-to-the-first-computational-law-blockchain-festival/.

  7. 7.

    https://runtimeverification.com/blog/?p=496.

  8. 8.

    Note that this also works if multiple transactions run in a concurrent context; isolation is maintained because the boxes themselves are not updated.

  9. 9.

    Another extensively documented example can be found in [23].

  10. 10.

    We are currently consolidating both into a common datetime extension.

  11. 11.

    The actual syntax relied a little bit more on boxes and other semi-graphical elements; we use text here so we do not have to resort to images.

  12. 12.

    https://martinfowler.com/bliki/GivenWhenThen.html.

  13. 13.

    https://cucumber.io/.

  14. 14.

    An analogy that many of our users like to draw in more ways than is good for us!

  15. 15.

    Both of these points are clearly illustrated by a customer’s (not very satisfying) attempt at building a whole range of business DSLs with Groovy.

  16. 16.

    https://www.eclipse.org/Xtext/.

  17. 17.

    http://www.eclipse.org/xtend/.

  18. 18.

    https://kotlinlang.org/.

  19. 19.

    https://ceylon-lang.org/.

  20. 20.

    https://racket-lang.org/.

  21. 21.

    https://www.lua.org/.

References

  1. Amani, S., Bégel, M., Bortin, M., Staples, M.: Towards verifying Ethereum smart contract bytecode in Isabelle/HOL. In: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, CPP 2018, 8–9 January 2018, Los Angeles, CA, USA, pp. 66–77 (2018). https://doi.org/10.1145/3167084

  2. Berger, T., Völter, M., Jensen, H.P., Dangprasert, T., Siegmund, J.: Efficiency of projectional editing: a controlled experiment. In: Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 763–774. ACM (2016)

    Google Scholar 

  3. Booth, S.P., Jones, S.B.: Walk backwards to happiness: debugging by time travel. In: Proceedings of the 3rd International Workshop on Automatic Debugging (AADEBUG 1997), no. 001, pp. 171–184. Linköping University Electronic Press (1997)

    Google Scholar 

  4. Bousse, E., Degueule, T., Vojtisek, D., Mayerhofer, T., Deantoni, J., Combemale, B.: Execution framework of the GEMOC studio (tool demo). In: Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, pp. 84–89. ACM (2016)

    Google Scholar 

  5. Dean, J., Ghemawat, S.: MapReduce: simplified data processing on large clusters. Commun. ACM 51(1), 107–113 (2008)

    Article  Google Scholar 

  6. DeRemer, F., Kron, H.H.: Programming-in-the-large versus programming-in-the-small. IEEE Trans. Softw. Eng. 2, 80–86 (1976)

    Article  MathSciNet  Google Scholar 

  7. Douceur, J.R.: The sybil attack. In: Druschel, P., Kaashoek, F., Rowstron, A. (eds.) IPTPS 2002. LNCS, vol. 2429, pp. 251–260. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45748-8_24

    Chapter  Google Scholar 

  8. Efftinge, S., Eysholdt, M., Köhnlein, J., Zarnekow, S., von Massow, R., Hasselbring, W., Hanus, M.: Xbase: implementing domain-specific languages for Java. ACM SIGPLAN Not. 48, 112–121 (2012)

    Google Scholar 

  9. Erdweg, S., Giarrusso, P.G., Rendel, T.: Language composition untangled. In: Proceedings of the Twelfth Workshop on Language Descriptions, Tools, and Applications, p. 7. ACM (2012)

    Google Scholar 

  10. Fowler, M.: Language workbenches: the killer-app for domain specific languages (2005)

    Google Scholar 

  11. Frantz, C.K., Nowostawski, M.: From institutions to code: towards automated generation of smart contracts. In: IEEE International Workshops on Foundations and Applications of Self* Systems, pp. 210–215. IEEE (2016)

    Google Scholar 

  12. Gibbons, R.: A Primer in Game Theory. Harvester Wheatsheaf, Bushey (1992)

    MATH  Google Scholar 

  13. Hanmer, R.: Patterns for Fault Tolerant Software. Wiley, Chichester (2013)

    Google Scholar 

  14. Hickey, R.: The Clojure programming language. In: Proceedings of the 2008 Symposium on Dynamic Languages, p. 1. ACM (2008)

    Google Scholar 

  15. Hirai, Y.: Defining the Ethereum virtual machine for interactive theorem provers. In: Brenner, M., et al. (eds.) FC 2017. LNCS, vol. 10323, pp. 520–535. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-70278-0_33

    Chapter  Google Scholar 

  16. Jensen, C.S., Snodgrass, R.T.: Temporal data management. IEEE Trans. Knowl. Data Eng. 11(1), 36–44 (1999)

    Article  Google Scholar 

  17. Jia, Y., Harman, M.: An analysis and survey of the development of mutation testing. IEEE Trans. Softw. Eng. 37(5), 649–678 (2011)

    Article  Google Scholar 

  18. Korpela, K., Hallikas, J., Dahlberg, T.: Digital supply chain transformation toward blockchain integration. In: Proceedings of the 50th Hawaii International Conference on System Sciences (2017)

    Google Scholar 

  19. Narasimban, P., Moser, L.E., Melliar-Smith, P.M.: Using interceptors to enhance CORBA. Computer 32(7), 62–68 (1999)

    Article  Google Scholar 

  20. Odersky, M., Altherr, P. Cremet, V., Emir, B., Maneth, S., Micheloud, S., Mihaylov, N., Schinz, M., Stenman, E., Zenger, M.: An overview of the Scala programming language. Technical report (2004)

    Google Scholar 

  21. Peters, G.W., Panayi, E.: Understanding modern banking ledgers through blockchain technologies: future of transaction processing and smart contracts on the internet of money. In: Tasca, P., Aste, T., Pelizzon, L., Perony, N. (eds.) Banking Beyond Banks and Money, pp. 239–278. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-42448-4_13

    Chapter  Google Scholar 

  22. Tapscott, D., Tapscott, A.: Blockchain Revolution: How the Technology Behind Bitcoin is Changing Money, Business, and the World. Penguin, Toronto (2016)

    Google Scholar 

  23. Voelter, M.: A smart contract development stack. Posted 6 December 2017

    Google Scholar 

  24. Voelter, M.: Language and IDE modularization and composition with MPS. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2011. LNCS, vol. 7680, pp. 383–430. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-35992-7_11

    Chapter  Google Scholar 

  25. Voelter, M.: The kernelF reference (2018)

    Google Scholar 

  26. Voelter, M.: Language development with MPS - a quick overview (2018)

    Google Scholar 

  27. Voelter, M., vand Deursen, A., Kolb, B., Eberle, S.: Using C language extensions for developing embedded software: a case study. In: Proceedings of OOPSLA 2015, pp. 655–674. ACM (2015)

    Article  Google Scholar 

  28. Voelter, M., Kolb, B., Szabó, T., Ratiu, D., van Deursen, A.: Lessons learned from developing mbeddr: a case study in language engineering with MPS. Softw. Syst. Model. (2017). https://doi.org/10.1007/s10270-016-0575-4

  29. Voelter, M., Lisson, S.: Supporting diverse notations in MPS’ projectional editor. In: GEMOC Workshop (2014)

    Google Scholar 

  30. Voelter, M., Ratiu, D., Kolb, B., Schaetz, B.: mbeddr: instantiating a language workbench in the embedded software domain. Autom. Softw. Eng. 20(3), 1–52 (2013)

    Article  Google Scholar 

  31. Voelter, M. Szabó, T., Lisson, S., Kolb, B., Erdweg, S., Berger, T.: Efficient development of consistent projectional editors using grammar cells. In: Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, pp. 28–40. ACM (2016)

    Google Scholar 

  32. Wood, G.: Ethereum: a secure decentralised generalised transaction ledger. Ethereum Proj. Yellow Pap. 151, 1–32 (2014)

    Google Scholar 

Download references

Acknowledgements

I implemented most of KernelF myself. However, this would not have been possible without the team at itemis: they were sparring partners in design discussions, they helped mature the language by using and stressing it, they built some of the features in the case studies, and generally provided the fertile ground on which something like KernelF can flourish. I also want to thank our customers. Not just those of the particular systems described in the case studies, but all of them: without their trust in us and, ultimately, their money, none of what is discussed in this paper would have happened. Finally, I want to thank the MPS team at Jetbrains for building an amazing tool and for helping us use it productively over the years.

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Voelter, M. (2018). The Design, Evolution, and Use of KernelF. In: Rensink, A., Sánchez Cuadrado, J. (eds) Theory and Practice of Model Transformation. ICMT 2018. Lecture Notes in Computer Science(), vol 10888. Springer, Cham. https://doi.org/10.1007/978-3-319-93317-7_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-93317-7_1

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-93316-0

  • Online ISBN: 978-3-319-93317-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics