JPX-Lang Syntax — Complete Language Reference for JPX Programming

JPX-Lang Syntax Guide — Complete Language Reference for JPX Programming
After introducing JPX-Lang as an experimental programming language, many developers started asking a simple question:
What does JPX code actually look like?
In this article we will explore the syntax and core features of JPX-Lang, including variables, control flow, modules, lists, objects, and built-in libraries.
This guide serves as a complete overview of the JPX language syntax.
Official Website 👉 https://jpx-lang.netlify.app/
GitHub Repository 👉 https://github.com/alzzmetth/jpxlang
What is JPX-Lang?
JPX-Lang (Jaguar Programming Xtreme) is a scripting-style programming language designed with a focus on:
- simple syntax
- readable structure
- scripting flexibility
- modular functionality
The language combines ideas from modern scripting languages while keeping the syntax minimal and beginner-friendly.
1. Comments
Comments in JPX use the **# symbol**, similar to Python.
# Ini adalah komentar
print "Hello JPX";
print "Hello"; # komentar di akhir baris
Comments are ignored by the interpreter and used only for documentation.
2. Data Types
JPX provides several built-in data types.
TypeExampleDescriptionInteger42, -7Whole numbersFloat3.14, 2.0Decimal numbersString"Hello"Text valuesBooleantrue, falseLogical valuesNullnullRepresents no valueList[1,2,3]Ordered collectionObject{nama:"JPX"}Key-value structure
Example:
global [x = 10];
global [pi = 3.14];
global [name = "JPX"];
global [active = true];
3. Variables
Variables in JPX are declared using **global**.
Variable Declaration
global [x = 10];
global [name = "Budi"];
global [numbers = [1,2,3]];
Assignment
Variables can be modified later.
x = 20;
numbers[0] = 99;
JPX allows flexible assignments including list and object modification.
4. Operators
JPX supports common programming operators.
Arithmetic Operators
OperatorFunction+addition / string concatenation-subtraction*multiplication/division
Example:
global [a = 10];
global [b = 5];
print a + b;
print a * b;
Comparison Operators
OperatorMeaning==equal!=not equal<less than>greater than<=less or equal>=greater or equal
Example:
if a > b {
print "a lebih besar";
}
Logical Operators
JPX uses word-based logical operators.
OperatorMeaningandlogical ANDorlogical ORnotlogical NOT
Example:
if umur > 18 and aktif == true {
print "User valid";
}
5. Strings
Strings in JPX use double quotes.
print "Hello JPX";
String Interpolation
JPX supports variable interpolation using $.
global [nama = "Budi"];
print "Halo $nama";
Output:
Halo Budi
Multi-line Strings
JPX supports triple-quote multi-line strings.
global [text = """
Baris pertama
Baris kedua
Baris ketiga
"""];
This is useful for documentation or long text output.
6. Lists
Lists are ordered collections.
global [angka = [1,2,3,4,5]];
print angka[0];
Modify list values:
angka[1] = 99;
Lists are flexible and can store mixed data types.
global [data = [1,"teks",true]];
7. Objects (Dictionary)
Objects store key-value pairs.
global [user = {
nama: "Aldrian",
umur: 25
}];
Access values:
print user["nama"];
Some interpreters may also support dot notation:
print user.nama;
Objects can be expanded dynamically.
user["kota"] = "Jakarta";
8. Control Structures
JPX includes typical programming control flow structures.
If / Else
if kondisi {
print "True";
} else {
print "False";
}
Example:
if x > 10 {
print "besar";
} else {
print "kecil";
}
Nested conditions are also supported.
While Loop
global [i = 1];
while i <= 5 {
print i;
i = i + 1;
}
This loop will print numbers from 1 to 5.
For Loop
JPX supports two styles.
Range Loop
for i = 1 to 10 {
print i;
}
List Iteration
global [buah = ["apel","mangga","jeruk"]];
for b in buah {
print b;
}
Loop Control
Two special statements exist.
StatementFunctionbreakexit loopcontinueskip iteration
Example:
for i = 1 to 10 {
if i == 5 {
break;
}
print i;
}
9. Input and Output
Output with print
print "Hello World";
print 42;
print variabel;
Input using Scanner Module
[scanner];
scanner.input "Nama: ";
global [nama = scanner.read()];
Read integer input:
global [umur = scanner.read_int()];
10. Modules
JPX uses square brackets for module imports.
[print];
[color];
[requests];
[time];
After importing, module functions can be used directly.
Example:
[color];
print color.red("Hello");
11. Built-in Constants
JPX includes three special constants.
true
false
null
These represent boolean and null values.
12. Function Calls
JPX supports two calling styles.
Standard style
print("Hello");
result = add(5,3);
JPX style (no parentheses)
print "Hello";
result = add 5,3;
This flexibility allows more scripting-style code.
13. Standard Library Modules
JPX provides several built-in modules.
Print Module
[print];
print "Hello";
Color Module
[color];
print color.red("Merah");
print color.green("Hijau");
Time Module
[time];
print time.now;
time.wait 2;
HTTP Requests
[requests];
global [res = requests.fetch "https://api.example.com"];
print res.status;
Speedreq (Fast HTTP)
[speedreq];
global [res = speedreq.fetch "https://api.example.com"];
Fetch multiple URLs:
global [results = speedreq.fetch_many [url1,url2,url3]];
14. Syntax Rules
JPX follows several syntax rules.
- every statement ends with
; - blocks use
{ } - language is case-sensitive
- whitespace does not affect execution
Example:
print "Hello";
15. Complete Example Program
Below is a small JPX program.
[print];
[color];
[scanner];
print color.cyan("=== BIODATA ===");
scanner.input "Nama: ";
global [nama = scanner.read()];
scanner.input "Umur: ";
global [umur = scanner.read_int()];
if umur >= 17 {
print color.green("$nama sudah dewasa");
} else {
print color.yellow("$nama masih anak-anak");
}
print "Terima kasih!";
This program reads user input and prints different output depending on the age.
Final Thoughts
JPX-Lang is designed to be simple, expressive, and flexible.
Its syntax combines elements of scripting languages with a modular system that allows developers to easily extend functionality.
Although still experimental, JPX already provides:
- variables
- lists
- objects
- control flow
- modules
- HTTP requests
- console utilities
Developers interested in exploring JPX can visit:
Official Website https://jpx-lang.netlify.app/
GitHub Repository https://github.com/alzzmetth/jpxlang
As the project evolves, JPX-Lang will continue expanding its syntax, libraries, and tooling ecosystem.
메타데이터
- post_id
- fc4ad06b66ea
- slug
- jpx-lang-syntax-complete-language-reference-for-jpx-programming-fc4ad06b66ea
- url
- https://medium.com/@alzrwr111/jpx-lang-syntax-complete-language-reference-for-jpx-programming-fc4ad06b66ea
- canonical_url
- https://medium.com/@alzrwr111/jpx-lang-syntax-complete-language-reference-for-jpx-programming-fc4ad06b66ea
- author_url
- https://medium.com/@alzrwr111
- status
- ok
- fetched_at
- 2026-06-21 22:26:41