This book is adapted from the 12th iT Bangbang Iron Man Competition IoT Group Selection Series Article \"I Want to Run Ruby on a Microcontroller\". In the process of learning programming languages, as we understand more and more knowledge and skills, we inevitably need to have a deeper understanding of the language we use. This is a book about programming language design. We will use mruby, a Ruby language designed for embedded systems, to reproduce some functions of the Ruby virtual machine step by step, and in this way gradually understand the implementation of a language and execute it on the development board. In addition, this also helps us rethink the operation of virtual machines and the relationship between languages when using programming languages. Content Highlights We will start by reading the source code and learn from the experience of our predecessors how to build a language virtual machine, and gradually realize a simplified virtual machine that can be executed on the ESP8266 development board and has object-oriented features. Addition virtual machine It is not as difficult as we imagined to realize a language virtual machine. Our first virtual machine will be aimed at realizing Ruby\'s \"addition\" and complete a *simple virtual machine through hundreds of lines of code. Implementing logical judgments Adding if-type judgments to our virtual machine, through such virtual machine implementation, the program can perform complex behaviors as we expect. Implementing object-oriented Ruby language is an object-oriented feature. We will discuss how to manage object packaging information and convert C language code into methods that can be directly called in Ruby. Verifying ideas with tests The goal of this book is to implement a virtual machine that can be executed on the ESP8266 development board. In order to reduce the steps of repeatedly uploading programs to the development board, we can verify whether each virtual machine implementation works as we expect by writing tests. Target readers People who want to understand the operating principles of programming languages. People who want to write better programs. People who want to use different programming languages on the development board. Features of this book: Step by step creation of a language virtual machine, in-depth understanding of the operating principles of the programming language. Each function has a complete implementation, which makes it easier to understand the implementation of the language virtual machine. By writing a test verification program, you can learn software testing skills in addition to learning the implementation. The basic principles of the mruby virtual machine are analyzed in detail, and the learning of the language virtual machine is guided in a simplified way. About the author: Cang Shi Xianye (Qiu Zhengxian) I am a seeker of software development, Cang Shi Xianye, and I mainly use the Ruby language, which is like a sage\'s stone. I hope to find a way to make everyone enjoy the fun of programming on the road of software development, and allow more excellent programs to be designed in the world. Contents | CHAPTER 01 | Basics | 1.1 Virtual Machine | 1.2 C Language Concepts | 1.3 Getting Started with mruby | 1.4 Microcontrollers | CHAPTER 02 | Tips for Reading Source Code | 2.1 Octotree Extension | 2.2 Sourcegraph Extension | 2.3 Getting Familiar with the Language | CHAPTER 03 | Getting Started with mruby-L1VM | 3.1 Getting Started with Examples | 3.2 Initializing a Virtual Machine | 3.3 Starting a Virtual Machine | 3.4 Handling IREP | 3.5 Handling OPCode | 3.6 Concepts of Virtual Machines
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore