JARU is currently in closed beta phase. It’s ready for use to build your programs, but it’s not stable enough, and will likely have significant changes between minor versions. So, make sure to read the changelog carefully each time you update to a new beta version.

Introduction
JARU is a general-purpose programming language that focuses on simplicity and code readability. It’s object-oriented, with dynamic types, and runs on a fast and compact virtual machine.
It’s designed to run on devices with limited resources, such as the ESP32 or RISC-V. Its virtual machine is specially optimized to take up little memory space and to run quickly and efficiently, making it particularly suitable for IoT developments. With JARU, you’ll be able to develop applications more efficiently and adaptably. Moreover, its dynamic typing will allow you to work more quickly and straightforwardly.
Features
- Dynamic data types: JARU is a dynamically typed programming language, meaning it doesn’t require specifying a data type for a variable before assigning it a value. This can simplify the code and make it easier to write and read.
- Clean and straightforward syntax: JARU features an easy-to-learn and understand syntax, making it an accessible language for both beginner and experienced programmers.
- Garbage collector built into the VM: forget about freeing the memory reserved by your code
- High customizability: JARU is a highly customizable language, with a wealth of options and tools to tailor it to a project’s specific needs.
- Productivity: JARU enables faster and more efficient code writing, which can boost programmer productivity.
- Flexibility: JARU is an extremely versatile language, allowing for easy adaptation to various projects and environments.
Use of semicolons
In JARU, as in other programming languages, an instruction is a statement that gets executed in a program, granting the program the ability to carry out a specific task or action. An instruction can be a value assignment to a variable, a function call, or a class declaration.
Using a semicolon to end an instruction in JARU is optional, meaning you can choose whether or not to use it at any given time. However, it’s good practice to use the semicolon to separate instructions from one another, as it makes the code more readable and easier to understand.
Furthermore, using the semicolon helps prevent errors when writing code, especially when working with multiple instructions on the same line. In this case, the semicolon clearly distinguishes each of the instructions.
Code comments
You can use comments to include notes and explanations in your code that won’t be executed. Comments are useful for recalling the purpose of a code section or for temporarily disabling code.
To add a single-line comment in JARU, you can use the characters //
before the line of text you wish to mark as a comment. For example:
// This is a one line comment.
To add multi-line comments, you can use the /* characters to start the comment and the */ characters to end the comment. For example:
/*
This is a
multi-line comment.
*/
It’s important to note that comments are ignored by the JARU compiler and have no effect on the execution of your code. They are merely a tool to help you document and better understand the code.
Identation
JARU allows programmers to use any type of indentation in their code, without being bound to a specific form. Indentation in JARU is primarily used to enhance the readability and structure of the code, and can be done with any number of spaces or tabs, depending on the programmer’s personal style. However, it’s common to follow certain indentation best practices to improve readability and collaboration with other programmers.
Identifiers
Identifiers are the names used to identify variables, functions, classes, objects, properties, and methods. Identifiers in JARU can be any combination of letters, numbers, and underscores. Additionally, they must start with a letter or an underscore and cannot be a keyword of the language.
Identifiers in JARU are case-sensitive, meaning that “myClass” and “myclass” are two different identifiers. It’s important to choose clear and descriptive identifiers to help keep the code organized and easy to understand.
Valid identifiers
- nombre_persona
- numero_telefono
- edad
- _precio
- mi_variable
- miClase
- mi_metodo
- VAR_1
- _valor
- VARIABLE_LARGA
Invalid identifiers
- Comenzar con un número: “1number”
- Contener caracteres no alfanuméricos, como por ejemplo: “#%@”
- Palabras reservadas del lenguaje: “class”, “def”, “end”, etc.
- Espacios en blanco: “mi identificador”
Hello World!
Let’s create our first program in JARU, which simply prints the message “Hello, world!” to the console.
Let’s start with a brief explanation of the commands print and println, which are used to display text in the console.
The print() function displays text on the console without adding a newline at the end. If you call print() multiple times with different arguments, each call will print its result on the same line.
For example, if you run the following code:
println("Hello");
println(", ");
println("World");
The following text will be displayed in the console:
Hello
,
world
The main difference between print()
and println()
in JARU is that print()
does not add a newline at the end, while println()
does. This can be useful depending on how you want to format the output on the console.
Open your favorite code editor and create a new file with a “.aru” extension. If you’re new to programming or unsure about which editor to use, Visual Studio Code (with the JARUVC extension) is a good choice.
print("Hello World!");