 Lua in Ireland, so hello. I'm Yancha Zul. I came from a tropical paradise called Costa Rica and today I will talk you a little bit about an implementation of Lua inside the Irland virtual machine. So Lua is an implementation of standard Lua written in Irland OTP. Lua is a powerful, efficient, as you know, lightweight, embeddable scripting language that is common in games, Internet of Theme Devices, scientific computing research and supports, well, almost everything. You can do procedural programming, object-oriented programming with it, functional programming, well, almost everything. A little bit about Lua. Lua was born out of necessity, initially developed as a result of strict trade barriers instituted by the Brazilian government. Apparently, around that time, you cannot import software, so they built this language for their own purpose, was created by Roberto Irosalinski, Luis Enrique de Figueiredo, and Walter Marcelles at the Pontifical Catholic University of Rio. Lua is portable, is very small, is simple, in portability, you can find Lua inside NetBSD kernel, inside the Olivetti printers, you can find Lua inside your card dashboard, if you are on Mercedes or Volvo, is basically everywhere. It's simple and has a strong emphasis on scripting. Scripting, Lua is very simple, it only has very few power mechanisms, like associative arrays, to implement all data structures, called tables, have closures, which are first class anonymous functions with lexical scope, that's kind of the technicality, and coroutines. One shows continuations, but in the case of Lua, we really don't interact or have coroutines in the implementation, because what we use are the capabilities that the Beam Virtual Machine gives us to exploit multiple processes at the same time. It's a scripting language used to control other languages in the sense, not on other dynamic languages, like Python or Perl, but in the sense of Unix shields. With Lua, you always have like a program that is all the time written in two different languages. You have the system language, which gives you like the stable parts of your application, the algorithms and data structure, and you usually use Lua as the scripting language in the flexible and easy parts of your development. Erlan is a concurrent functional language that runs on his unscalable fault tolerance of real-time virtual machine called the Beam. It was created on the 80s by the team of Mike Williams, Robert Bearding, and Joe Armstrong at the Ericsson Computing Science Lab. It was later released as open source in the ID2, thanks to an effort of a group led by Jane Waldrup. The problem domain that they had in the 80s was telephony. So they have a switch called the AXE, and apparently it was very cumbersome to develop and maintain, so they have a problem. They need to find a replacement or at least develop some tool and some system with all of these capabilities, something that maintains massive concurrently, something that is fault-tolerant with timing constraint. Apparently if you are a telecom company and you sell equipment, you pay a lot of cash, you know, if you broke all these constraints, they are in your contract, so it's a very important issue. You need the capability to continue operating the system, and you can't shut it down at any time, like you know, if you take a phone, you expect always to have line. It's not that you have like the time frame at 12 o'clock to restore all the country communications, so they have this problem, and Irland is the result of that problem. It's not an academic implementation of a functional language, and it's not an academic implementation of the actor model. They later discovered the Carhewitz papers and compare, but it's not that they were pursuing that goal. So what is the BIM? Basically the BIM is a virtual machine that runs Irland. It has some internal properties that you basically don't need to worry about. It gives you this massive concurrency, a synchronous communication, multiple process isolated from each other. You have error handling capabilities, the feature to hot code reload at any time, and support introspection and monitoring. You only have to worry about send and receiving messages, and it also have some external properties, which is what the developers see or interact with. You have immutable data, an external model machine. It's a functional language with a predefined set of data types. You have modules as the unit of encapsulating code, and no global data. When you develop Irland, there is this thing called the OTP, which is basically the framework that you use if you are an Irland developer to make your things. It's a collection of libraries and tools. It basically gives you the concept of an application and different behaviors like finance state machines, the client and server abstraction. You have like supervision trees, and that sort of things. In this environment, we have what we call the beam ecosystem, which are different languages that are built to live inside and interact with Irland and OTP, and the beam at the lowest level of the infrastructure that, again, is just a virtual machine to run Irland. Lua, on the other side, is famous for giving you mechanisms and not policies. It's a simple language with simple concepts that provide you the mechanisms to implement the rest of the fancy features that you might need instead of provide all of that directly to you. It also has an ecosystem, like the standard official Lua from Brazil. Lua Jit and Raptor Jit, Moonscript, which is kind of a different language built on top. Lua, which is the reason that I'm here, and many more implementations. The goal of Lua is to give you a proper implementation of the Lua language. What Robert Building, the creator of Lua, was looking when he created this project, was not build a language that is like Lua on the beam, but is give you the complete native Lua, but for this ecosystem. Like the standard Lua, Lua is implemented as a library. The beam is a mixture of interpreting Lua virtual machine instructions using Irland directly to implement the function calls. Additional of the features that you might have on common native Lua, it gives you fast language switch between Irland and Lua. It exploits the capabilities of the beam virtual machine, give you a transparent, give you the way to transparently utilize your multi core machines. So Lua is a complete re-implementation of the Lua language, including an Irland API that matched the C API available on the standard Lua. Some trade-off of both languages. Lua is commonly not good for concurrency and multi-core parallelism. The standard library is not very large and give you a do-it- yourself approach to life, which is not a very bad thing. It's just the way it works. Irland is not good for heavy number crunching, lower term mutable state, or your common desktop re-application or mobiles. The result of this implementation gives you a complete Lua that offers great interaction not only between Irland but Elixir, LFE and all the rest of our friends on this ecosystem. In the implementation or using Lua, we keep our Lua state in one data structure and we explicitly trade it through everything. This trading of stock is what we typically do in Irland anyway. With that in mind is similar of what Roberto Jerozalinski called the eye of the needle approach, which is using all these mechanisms that Lua gives you to try it in your head to see how you need to use them with the eye of the needle example, pass all your data structures and your code around the IPI. Lua embrace both Lua land and Irland communities and I guess my goal of this presentation is at least spark your curiosity to check it out, to learn more about Irland, to use more Lua inside that ecosystem. I personally believe that both communities are very simple, diverse and complementary and great languages. That's my presentation, so thank you. If you're interested. All right, so any question? No? All right. Yes. Not with me, but I can show you outside in the, not right here in the presentation, but for sure. It is. It is. How does it fit with the beam? It is. So Robert builds his own Lua virtual machine in top of the beam, so you interpret code and it's interpreted exactly. There is an interpreted and virtual machine implementation. Yes. Right now is a dot, right now we are currently working on the five dot three implementation and I think there is a ready for, for prime time, but we need users and we need all the help that we can get with the bug reporting. So welcome to, you are welcome to check it out and that's it.