29,99 €
C++ is a popular choice in the developer community for building complex and large-scale performant applications and systems. Often a need arises to extend the system at runtime, without recompiling the whole C++ program. Using a scripting language like Lua can help achieve this goal efficiently.
Integrate Lua to C++ is a comprehensive guide to integrating Lua to C++ and will enable you to achieve the goal of extending C++ programs at runtime. You’ll learn, in sequence, how to get and compile the Lua library, the Lua programming language, calling Lua code from C++, and calling C++ code from Lua. In each topic, you’ll practice with code examples, and learn the in-depth mechanisms for smooth working. Throughout the book, the latter examples build on the earlier ones while also acting as a standalone. You’ll learn to implement Lua executor and Lua binding generator, which you can use in your projects directly with further customizations.
By the end of this book, you’ll have mastered integrating Lua into C++ and using Lua in your C++ project efficiently, gained the skills to extend your applications at runtime, and achieved dynamic and adaptable C++ development.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 237
Veröffentlichungsjahr: 2023
Seamlessly integrate Lua scripting to enhance application flexibility
Wenhuan Li
BIRMINGHAM—MUMBAI
Copyright © 2023 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Group Product Manager: Kunal Sawant
Publishing Product Manager: Akash Sharma
Senior Editor: Esha Banerjee
Technical Editor: Maran Fernandes
Copy Editor: Safis Editing
Project Coordinator: Deeksha Thakkar
Proofreader: Safis Editing
Indexer: Manju Arasan
Production Designer: Alishon Mendonca
Business Development Executive: Debadrita Chatterjee
Marketing Coordinator: Sonia Chauhan
Production reference: 1131023
Published by Packt Publishing Ltd.
Grosvenor House
11 St Paul’s Square
Birmingham
B3 1RB, UK
ISBN 978-1-80512-861-8
www.packtpub.com
To my father, mother, and uncle who gifted me an 8086 when I was 8 years old. To all ordinary people who work hard and stay true to their honors. To all the developers who are constantly learning and crafting.
– Wenhuan Li
Wenhuan Li is a software architect and full stack developer. He started his career in the chip design industry, where he worked on embedded software and development tools. Over the past decade, Wenhuan has primarily focused on mobile applications and backend services and was associated with big tech companies such as Meta, Bloomberg, Booking.com, and McAfee.
Emilio Panighetti brings over twenty years of experience in software development, with the last decade dedicated to working on embedded platforms and cloud-native applications in modern C++ and Lua for Oracle Communications, which are widely utilized globally. Emilio began his career as a researcher and assistant teacher in college. Later, he co-founded an early internet provider, before moving on to collaborate with various unified communications providers and development houses. In his spare time, he engages in home IoT projects.
For inquiries, you can contact him via email at [email protected].
This part of the book will guide you through the process of getting and compiling Lua from the source code. Then, you will explore some options to set up your C++ projects to use Lua. This will be followed by a brief introduction to the Lua programming language.
Hence, the aim of this part is to prepare you for the real work of integrating Lua into C++. Feel free to skip through some of the topics if you are already familiar with them.
This part comprises the following chapters:
Chapter 1, Getting Your C++ Project Lua-ReadyChapter 2, Lua Fundamentals