skip to main content
10.1145/3167082acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Mechanising and verifying the WebAssembly specification

Published:08 January 2018Publication History

ABSTRACT

WebAssembly is a new low-level language currently being implemented in all major web browsers. It is designed to become the universal compilation target for the web, obsoleting existing solutions in this area, such as asm.js and Native Client. The WebAssembly working group has incorporated formal techniques into the development of the language, but their efforts so far have focussed on pen and paper formal specification.

We present a mechanised Isabelle specification for the WebAssembly language, together with a verified executable interpreter and type checker. Moreover, we present a fully mechanised proof of the soundness of the WebAssembly type system, and detail how our work on this proof has exposed several issues with the official WebAssembly specification, influencing its development. Finally, we give a brief account of our efforts in performing differential fuzzing of our interpreter against industry implementations.

References

  1. Mark Batty, Kayvan Memarian, Kyndylan Nienhuis, Jean Pichon-Pharabod, and Peter Sewell. 2015. The Problem of Programming Language Concurrency Semantics . Springer Berlin Heidelberg, Berlin, Heidelberg, 283–307.Google ScholarGoogle Scholar
  2. Martin Bodin, Arthur Chargueraud, Daniele Filaretti, Philippa Gardner, Sergio Maffeis, Daiva Naudziuniene, Alan Schmitt, and Gareth Smith. 2014. A Trusted Mechanised JavaScript Specification. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’14) . ACM, New York, NY, USA, 87–100. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. CakeML project. 2017. CakeML Projects. (2017). Retrieved October 7, 2017 from https://cakeml.org/projectsGoogle ScholarGoogle Scholar
  4. Ethereum Group. 2017. eWASM. (2017). Retrieved October 7, 2017 from https://github.com/ewasmGoogle ScholarGoogle Scholar
  5. Google. 2017. Welcome to Native Client. (2017). Retrieved October 7, 2017 from https://developer.chrome. com/native-clientGoogle ScholarGoogle Scholar
  6. Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. 2017a. Bringing the Web Up to Speed with WebAssembly. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017) . ACM, New York, NY, USA, 185–200. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Andreas Haas, Andreas Rossberg, Derek L. Schuff, Ben L. Titzer, Michael Holman, Dan Gohman, Luke Wagner, Alon Zakai, and JF Bastien. 2017b. Bringing the Web Up to Speed with WebAssembly. (March 2017). Retrieved October 7, 2017 from https://github.com/WebAssembly/ spec/blob/bbb26c42b62096baff86089767531c3b1f108a85/ papers/pldi2017.pdfGoogle ScholarGoogle Scholar
  8. David Herman, Luke Wagner, and Alon Zakai. 2014. asm.js. (August 2014). Retrieved October 7, 2017 from http://asmjs. org/spec/latestGoogle ScholarGoogle Scholar
  9. Yoichi Hirai. 2017. Defining the Ethereum Virtual Machine for Interactive Theorem Provers. In 1st Workshop on Trusted Smart Contracts .Google ScholarGoogle Scholar
  10. Gerwin Klein and Tobias Nipkow. 2006. A Machine-checked Model for a Java-like Language, Virtual Machine, and Compiler. ACM Trans. Program. Lang. Syst. 28, 4 (July 2006), 619–695. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Peter J Knaggs. 1993. Towards a Formal Forth. (September 1993). Retrieved October 7, 2017 from http://www.rigwit. co.uk/papers/formal2.pdfGoogle ScholarGoogle Scholar
  12. Ramana Kumar, Magnus O. Myreen, Michael Norrish, and Scott Owens. 2014. CakeML: A Verified Implementation of ML. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’14) . ACM, New York, NY, USA, 179–191. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Andreas Lochbihler and Lukas Bulwahn. 2011. Animating the Formalised Semantics of a Java-like Language. In Proceedings of the Second International Conference on Interactive Theorem Proving (ITP’11) . Springer-Verlag, Berlin, Heidelberg, 216–232. http://dl.acm.org/citation.cfm?id= 2033939.2033958 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jaanus Poial. 1990. Algebraic Specification of Stack Effects for Forth Programs. In Forml Conference Proceedings (Forml 1990) . The Forth Interest Group, San Jose, CA, USA, 282– 290. polymorphism and inheritance. In Proc. 18-th EuroForth Conference .Google ScholarGoogle Scholar
  15. James F. Power and David Sinclair. 2004. A Formal Model of Forth Control Words in the Pi-Calculus. J. UCS 10, 9 (2004), 1272–1293.Google ScholarGoogle Scholar
  16. Andreas Rossberg. 2017a. {spec} Fix and clean up invariants for host functions. (September 2017). Retrieved October 7, 2017 from https://github.com/WebAssembly/spec/pull/563Google ScholarGoogle Scholar
  17. Andreas Rossberg. 2017b. {spec} Fix and clean up invariants for host functions. (September 2017). Retrieved October 7, 2017 from https://github.com/WebAssembly/spec/ commit/772d87705ea4786c0d44d41902097e91cf31f82bGoogle ScholarGoogle Scholar
  18. Andreas Rossberg. 2017c. {spec} Fix and clean up invariants for host functions. (September 2017). Retrieved October 7, 2017 from https://github.com/WebAssembly/spec/pull/563Google ScholarGoogle Scholar
  19. TC39. 2017a. Memory Model. (September 2017). Retrieved October 7, 2017 from https://tc39.github.io/ecma262/ #sec-memory-modelGoogle ScholarGoogle Scholar
  20. TC39. 2017b. SIMD.js specification v0.9. (April 2017). Retrieved October 7, 2017 from http://tc39.github.io/ ecmascript_simd/Google ScholarGoogle Scholar
  21. Conrad Watt. 2017a. Conrad Watt. (October 2017). Retrieved November 27, 2017 from http://www.cl.cam.ac.uk/~caw77/Google ScholarGoogle Scholar
  22. Conrad Watt. 2017b. Crash in wasm-opt on certain optimisation levels. (August 2017). Retrieved October 7, 2017 from https://github.com/WebAssembly/binaryen/issues/1149Google ScholarGoogle Scholar
  23. WebAssembly Community Group. 2017a. Binaryen. (October 2017). Retrieved October 7, 2017 from https://github.com/ WebAssembly/binaryenGoogle ScholarGoogle Scholar
  24. WebAssembly Community Group. 2017b. Instructions. (September 2017). Retrieved October 7, 2017 from https: //webassembly.github.io/spec/binary/instructions.htmlGoogle ScholarGoogle Scholar
  25. WebAssembly Community Group. 2017c. WebAssembly. (2017). Retrieved October 7, 2017 from http://webassembly. orgGoogle ScholarGoogle Scholar
  26. WebAssembly Community Group. 2017d. WebAssembly. (October 2017). Retrieved October 7, 2017 from https:// github.com/WebAssembly/spec/tree/master/interpreterGoogle ScholarGoogle Scholar
  27. WebAssembly Community Group. 2017e. WebAssembly. (October 2017). Retrieved October 7, 2017 from https: //github.com/WebAssemblyGoogle ScholarGoogle Scholar
  28. WebAssembly Community Group. 2017f. WebAssembly Specification. (September 2017). Retrieved October 7, 2017 from https://webassembly.github.io/spec/Google ScholarGoogle Scholar
  29. Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. In Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11) . ACM, New York, NY, USA, 283–294. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Alon Zakai and Robert Nyman. 2013. Gap between asm.js and native performance gets even narrower with float32 optimizations. (December 2013). Retrieved October 7, 2017 from https://hacks.mozilla.org/2013/12/20/Google ScholarGoogle Scholar

Index Terms

  1. Mechanising and verifying the WebAssembly specification

    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
    • Published in

      CPP 2018: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs
      January 2018
      306 pages
      ISBN:9781450355865
      DOI:10.1145/3176245

      Copyright © 2018 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 8 January 2018

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate18of26submissions,69%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader