riser_ is a dynamically-typed programming language that supports basic programming constructs like variables, control structures, functions, and operators.
int
- Integer values (e.g., 1
, -42
)float
- Floating-point numbers (e.g., 3.14
, -0.5
)string
- Sequence of characters (e.g., "Hello, World"
)bool
- Boolean values (true
, false
)let
keyword. Example:
let x = 10;
let name = "India";
+
, -
, *
, /
, %
==
, !=
, <
, >
, <=
, >=
&&
(and), ||
(or), !
(not)if (x > 10) {
print("Greater than 10");
} else {
print("Less than or equal to 10");
}
while
, for
):
let i = 0;
while (i < 5) {
print(i);
i = i + 1;
}
for (let i = 0; i < 5; i = i + 1) {
print(i);
}
func greet(name) {
print("Hello, " + name);
}
greet("World");
func add(a, b) {
return a + b;
}
let result = add(5, 10);
print()
- Outputs text to the console.input()
- Reads user input (optional for your implementation).//
:
// This is a comment
// comment
func add(a, b) {
return a + b;
}
let x = 5;
let y = 10;
let result = add(x, y);
if (result > 10) {
print("Result is greater than 10");
} else {
print("Result is 10 or less");
}
Note: This implementation does not purely follow standard compiler/interpreter design principles and the theoretical aspects of formal languages and automata.