Skip to main content

Reference

Reserved Words

The following words are reserved in JARU and cannot be used as identifiers:

andbreakcaseclassconst
continuedefdefaultelforelse
endfalseforforeachfunc
ifinnilnotor
privatereturnswitchthenthis
trueuntilusevarwhile
xor

Operators

Arithmetic

OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulo
++Increment
--Decrement

Comparison

OperatorDescription
==Equal to
!=Not equal to
>Greater than
<Less than
>=Greater than or equal to
<=Less than or equal to

Logical

OperatorDescription
andLogical AND
orLogical OR
notNegation
xorExclusive OR

Assignment

OperatorDescription
=Assignment
+=Add and assign
-=Subtract and assign
*=Multiply and assign
/=Divide and assign
%=Modulo and assign

Data Types

TypeDescriptionExample
boolBooleantrue, false
integerInteger (32 bits)42, -10
floatFloating point (64 bits)3.14, -0.5
stringText string"hello", 'world'
listDynamic list[1, 2, 3]
mapDictionary{"a": 1}
arrayFixed-size array{1, 2, 3}
nilNull valuenil

Standard Functions

FunctionDescription
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

ModuleDescription
BitmapBMP image loading and manipulation
BytesByte and binary data manipulation
DisplayTFT screen and graphic display control
DrawGraphic primitives drawing functions
FileFile handling
GCGarbage Collector control
GPIOInput/output pin control
GridMap2D grid with pathfinding for games
HTTPHTTP client for REST requests
I2CI2C communication with sensors and peripherals
InputAbstract input system for keyboard/GPIO
JSONJSON parsing and generation
MathAdvanced math functions
MQTTMQTT protocol communication for IoT
PowerPower management and low consumption modes
SpriteSprite system with animation, collisions and physics
TimeDate and time functions
TimerTimers with asynchronous callbacks

Additional Resources