skip to main content
article
Public Access

FunTAL: reasonably mixing a functional language with assembly

Published:14 June 2017Publication History
Skip Abstract Section

Abstract

We present FunTAL, the first multi-language system to formalize safe interoperability between a high-level functional language and low-level assembly code while supporting compositional reasoning about the mix. A central challenge in developing such a multi-language is bridging the gap between assembly, which is staged into jumps to continuations, and high-level code, where subterms return a result. We present a compositional stack-based typed assembly language that supports components, comprised of one or more basic blocks, that may be embedded in high-level contexts. We also present a logical relation for FunTAL that supports reasoning about equivalence of high-level components and their assembly replacements, mixed-language programs with callbacks between languages, and assembly components comprised of different numbers of basic blocks.

Skip Supplemental Material Section

Supplemental Material

References

  1. A. Ahmed. Verified Compilers for a Multi-Language World. In T. Ball, R. Bodik, S. Krishnamurthi, B. S. Lerner, and G. Morrisett, editors, 1st Summit on Advances in Programming Languages (SNAPL 2015), volume 32 of Leibniz International Proceedings in Informatics (LIPIcs), pages 15–31, 2015.Google ScholarGoogle Scholar
  2. A. Ahmed and M. Blume. An equivalence-preserving CPS translation via multi-language semantics. In International Conference on Functional Programming (ICFP), Tokyo, Japan, pages 431–444, Sept. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. A. Ahmed, A. W. Appel, and R. Virga. An indexed model of impredicative polymorphism and mutable references. Available at http://www.cs.princeton.edu/ ∼appel/papers/impred.pdf, Jan. 2003.Google ScholarGoogle Scholar
  4. A. Ahmed, D. Dreyer, and A. Rossberg. State-dependent representation independence. In ACM Symposium on Principles of Programming Languages (POPL), Savannah, Georgia, Jan. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Ahmed, A. W. Appel, C. D. Richards, K. N. Swadi, G. Tan, and D. C. Wang. Semantic foundations for typed assembly languages. ACM Transactions on Programming Languages and Systems, 32(3):1–67, Mar. 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. A. J. Ahmed. Semantics of Types for Mutable State. PhD thesis, Princeton University, Nov. 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. N. Benton. A typed, compositional logic for a stack-based abstract machine. In Proceedings of the Third Asian Symposium on Programming Languages and Systems (APLAS), Tsukuba, Japan, pages 364–380, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. N. Benton and C.-K. Hur. Biorthogonality, step-indexing and compiler correctness. In International Conference on Functional Programming (ICFP), Edinburgh, Scotland, Sept. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Dreyer. RustBelt: Logical foundations for the future of safe systems programming. http://plv.mpi-sws.org/ rustbelt/, 2016. Accessed: 2016-11-15.Google ScholarGoogle Scholar
  10. D. Dreyer, G. Neis, and L. Birkedal. The impact of higherorder state and control effects on local relational reasoning. Journal of Functional Programming, 22(4&5):477–528, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. M. Furr and J. S. Foster. Checking type safety of foreign function calls. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Chicago, Illinois, pages 62–72, June 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. N. Glew and G. Morrisett. Type-safe linking and modular assembly language. In ACM Symposium on Principles of Programming Languages (POPL), San Antonio, Texas, pages 250–261, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C.-K. Hur and D. Dreyer. A Kripke logical relation between ML and assembly. In ACM Symposium on Principles of Programming Languages (POPL), Austin, Texas, Jan. 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. Jaber and N. Tabareau. The journey of biorthogonal logical relations to the realm of assembly code. Workshop on Low-Level Languages (LOLA), http://web.emn.fr/ x-info/ntabareau/fichiers/lola2011.pdf, 2011. Accessed: 2016-11-15.Google ScholarGoogle Scholar
  15. A. Larmuseau and D. Clarke. Formalizing a secure foreign function interface. In Proceedings of the 13th International Conference on Software Engineering and Formal Methods (SEFM), York, UK, pages 215–230, 2015.Google ScholarGoogle ScholarCross RefCross Ref
  16. J. Matthews and R. B. Findler. Operational semantics for multi-language programs. In ACM Symposium on Principles of Programming Languages (POPL), Nice, France, pages 3– 10, Jan. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. G. Morrisett, D. Walker, K. Crary, and N. Glew. From System F to typed assembly language. In ACM Symposium on Principles of Programming Languages (POPL), San Diego, California, pages 85–97, Jan. 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. G. Morrisett, K. Crary, N. Glew, and D. Walker. Stack-based typed assembly language. Journal of Functional Programming, 12(1):43–88, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. G. Neis, C.-K. Hur, J.-O. Kaiser, C. McLaughlin, D. Dreyer, and V. Vafeiadis. Pilsner: A compositionally verified compiler for a higher-order imperative language. In International Conference on Functional Programming (ICFP), Vancouver, British Columbia, Canada, Aug. 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. S. New, W. J. Bowman, and A. Ahmed. Fully abstract compilation via universal embedding. In International Conference on Functional Programming (ICFP), Nara, Japan, Sept. 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. D. Patterson, J. Perconti, C. Dimoulas, and A. Ahmed. FunTAL: Reasonably mixing a functional language with assembly (technical appendix). Available at http://www.ccs.neu.edu/home/amal/papers/ funtal-tr.pdf, Mar. 2017.Google ScholarGoogle Scholar
  22. J. T. Perconti and A. Ahmed. Verifying an open compiler using multi-language semantics. In European Symposium on Programming (ESOP), Apr. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G. Tan. JNI Light: An operational model for the core JNI. In Proceedings of the 8th Asian Conference on Programming Languages and Systems (APLAS), Shanghai, China, pages 114–130, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Tan, A. W. Appel, S. Chakradhar, R. Srivaths, A. Raghunathan, and D. Wang. Safe java native interface. In Proceedings of the 2006 IEEE International Symposium on Secure Software Engineering, pages 97–106, 2006.Google ScholarGoogle Scholar
  25. P. Wang, S. Cuellar, and A. Chlipala. Compiler verification meets cross-language linking via data abstraction. In ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), Oct. 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. FunTAL: reasonably mixing a functional language with assembly

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!