# What is Lua++?

Lua++ is a fully-featured new programming language for a wide range of applications that is fast, lightweight, and energy-efficient. The author created Lua++ with the goal of helping reduce carbon emissions through low power consumption, decreasing barriers to adoption on low-cost hardware platforms, and providing a tool for learning advanced computer science concepts.&#x20;

```typescript
class Triangle {
  base: integer,
  height: integer,
  
  constructor(base: integer, height: integer)
    self.base, self.height = base, height
  end,
  
  const function area(): integer ->
    return self.base * self.height / 2
}

print(Triangle(3, 4).area())
```

Borrowing from several modern languages, Lua++ adds proper object-oriented programming with a class hierarchy and encapsulation, templates, type annotations, events, macros, and much more. Overcoming the limitations of its popular predecessor, Lua++ is suitable for use by teams of developers in large cross-platform projects. The author designed the syntax, built a state-of-the-art optimizing compiler, composed an instruction set, and implemented a fast, compact virtual machine to run Lua++ bytecode in end-user applications. Based on performance tests consisting of several commonly used benchmarks, Lua++ is four to 25 times faster than classic Lua. This documentation gives an overview of the language, discusses rationales for feature choices made, and showcases Lua++’s advantages.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.luaplusplus.org/overview/what-is-lua++.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
