Reference
Reserved Words
The following words are reserved in JARU and cannot be used as identifiers:
and | break | case | class | const |
continue | def | default | elfor | else |
end | false | for | foreach | func |
if | in | nil | not | or |
private | return | switch | then | this |
true | until | use | var | while |
xor |
Operators
Arithmetic
| Operator | Description |
|---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulo |
++ | Increment |
-- | Decrement |
Comparison
| Operator | Description |
|---|---|
== | Equal to |
!= | Not equal to |
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
Logical
| Operator | Description |
|---|---|
and | Logical AND |
or | Logical OR |
not | Negation |
xor | Exclusive OR |
Assignment
| Operator | Description |
|---|---|
= | Assignment |
+= | Add and assign |
-= | Subtract and assign |
*= | Multiply and assign |
/= | Divide and assign |
%= | Modulo and assign |
Data Types
| Type | Description | Example |
|---|---|---|
bool | Boolean | true, false |
integer | Integer (32 bits) | 42, -10 |
float | Floating point (64 bits) | 3.14, -0.5 |
string | Text string | "hello", 'world' |
list | Dynamic list | [1, 2, 3] |
map | Dictionary | {"a": 1} |
array | Fixed-size array | {1, 2, 3} |
nil | Null value | nil |
Standard Functions
| Function | Description |
|---|---|
print(...) | Print without newline |
println(...) | Print with newline |
input(prompt) | Read user input |
pause(ms) | Pause execution |
clock() | Time since VM start |
chr(n) | Convert integer to character |
random() | Generate random number |
randomize(seed) | Initialize random generator |
abs(n) | Absolute value |
round(n) | Round to nearest integer |
sqrt(n) | Square root |
len(obj) | Length of string/list/map |
mem() | Memory used by VM |
int(n) | Convert to integer |
float(n) | Convert to float |
Available Modules
| Module | Description |
|---|---|
Bitmap | BMP image loading and manipulation |
Bytes | Byte and binary data manipulation |
Display | TFT screen and graphic display control |
Draw | Graphic primitives drawing functions |
File | File handling |
GC | Garbage Collector control |
GPIO | Input/output pin control |
GridMap | 2D grid with pathfinding for games |
HTTP | HTTP client for REST requests |
I2C | I2C communication with sensors and peripherals |
Input | Abstract input system for keyboard/GPIO |
JSON | JSON parsing and generation |
Math | Advanced math functions |
MQTT | MQTT protocol communication for IoT |
Power | Power management and low consumption modes |
Sprite | Sprite system with animation, collisions and physics |
Time | Date and time functions |
Timer | Timers with asynchronous callbacks |
Additional Resources
- Official website
- GitHub
- Contact: info@jarulang.com