WebAssembly in action with examples using C++ and Emscripten
WebAssembly in Action teaches you how to write and run high-performance browser-based applications using C++ and other languages supported by WebAssembly. In it, you’ll learn to create native WebAssembly modules, interact with JavaScript components, and maximize performance with web workers and pthr...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Shelter Island, NY :
Manning Publications
[2019]
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009630604906719 |
Tabla de Contenidos:
- Intro
- Copyright
- Brief Table of Contents
- Table of Contents
- Preface
- Acknowledgments
- About this Book
- About the Author
- About the Cover Illustration
- Part 1. First steps
- Chapter 1. Meet WebAssembly
- 1.1. What is WebAssembly?
- 1.2. What problems does it solve?
- 1.3. How does it work?
- 1.4. Structure of a WebAssembly module
- 1.5. WebAssembly text format
- 1.6. How is WebAssembly secure?
- 1.7. What languages can I use to create a WebAssembly module?
- 1.8. Where can I use my module?
- Summary
- Chapter 2. A look inside WebAssembly modules
- 2.1. Known sections
- 2.2. Custom sections
- Summary
- Chapter 3. Creating your first WebAssembly module
- 3.1. The Emscripten toolkit
- 3.2. WebAssembly modules
- 3.3. Emscripten output options
- 3.4. Compiling C or C++ with Emscripten and using the HTML template
- 3.5. Having Emscripten generate the JavaScript plumbing code
- 3.6. Having Emscripten generate only the WebAssembly file
- 3.7. Feature detection: How to test if WebAssembly is available
- Real-world use cases
- Exercises
- Summary
- Part 2. Working with modules
- Chapter 4. Reusing your existing C++ codebase
- 4.1. Using C or C++ to create a module with Emscripten plumbing
- 4.2. Using C or C++ to create a module without Emscripten
- Real-world use cases
- Exercises
- Summary
- Chapter 5. Creating a WebAssembly module that calls into JavaScript
- 5.1. Using C or C++ to create a module with Emscripten plumbing
- 5.2. Using C or C++ to create a module without Emscripten plumbing
- Real-world use cases
- Exercises
- Summary
- Chapter 6. Creating a WebAssembly module that talks to JavaScript using function pointers
- 6.1. Using C or C++ to create a module with Emscripten plumbing
- 6.2. Using C or C++ to create a module without Emscripten plumbing
- Real-world use cases
- Exercises.
- Summary
- Part 3. Advanced topics
- Chapter 7. Dynamic linking: The basics
- 7.1. Dynamic linking: Pros and cons
- 7.2. Dynamic linking options
- 7.3. Dynamic linking review
- Real-world use cases
- Exercises
- Summary
- Chapter 8. Dynamic linking: The implementation
- 8.1. Creating the WebAssembly modules
- 8.2. Adjusting the web page
- Real-world use cases
- Exercises
- Summary
- Chapter 9. Threading: Web workers and pthreads
- 9.1. Benefits of web workers
- 9.2. Considerations for using web workers
- 9.3. Prefetching a WebAssembly module using a web worker
- 9.4. Using pthreads
- Real-world use cases
- Exercises
- Summary
- Chapter 10. WebAssembly modules in Node.js
- 10.1. Revisiting what you know
- 10.2. Server-side validation
- 10.3. Working with Emscripten-built modules
- 10.4. Using the WebAssembly JavaScript API
- Real-world use cases
- Exercises
- Summary
- Part 4. Debugging and testing
- Chapter 11. WebAssembly text format
- 11.1. Creating the game's core logic using WebAssembly text format
- 11.2. Generating a WebAssembly module from the text format
- 11.3. The Emscripten-generated module
- 11.4. Creating the HTML and JavaScript files
- 11.5. Viewing the results
- Real-world use cases
- Exercises
- Summary
- Chapter 12. Debugging
- 12.1. Extending the game
- 12.2. Adjusting the HTML
- 12.3. Displaying the number of tries
- 12.4. Incrementing the number of tries
- 12.5. Updating the summary screen
- Exercises
- Summary
- Chapter 13. Testing-and then what?
- 13.1. Installing the JavaScript testing framework
- 13.2. Creating and running tests
- 13.3. Where do you go from here?
- Exercises
- Summary
- Appendix A. Installation and tool setup
- A.1. Python
- A.2. Emscripten
- A.3. Node.js
- A.4. WebAssembly Binary Toolkit
- A.5. Bootstrap.
- Appendix B. ccall, cwrap, and direct function calls
- B.1. ccall
- B.2. cwrap
- B.3. Direct function calls
- B.4. Passing an array to a module
- Appendix C. Emscripten macros
- C.1. emscripten_run_script macros
- C.2. EM_JS macros
- C.3. EM_ASM macros
- Appendix D. Exercise solutions
- D.1. Chapter 3
- D.2. Chapter 4
- D.3. Chapter 5
- D.4. Chapter 6
- D.5. Chapter 7
- D.6. Chapter 8
- D.7. Chapter 9
- D.8. Chapter 10
- D.9. Chapter 11
- D.10. Chapter 12
- D.11. Chapter 13
- Appendix E. Text format extras
- E.1. Control flow statements
- E.2. Function pointers
- WebAssembly in Action
- Index
- List of Figures
- List of Tables
- List of Listings.