ENIDE Language
ENIDE is a programming language designed to be written in any human language. The same program can be written in English, Portuguese, French, or any other supported language — only the keywords change, never the structure.
All examples in this documentation use English.
The exact same patterns apply in every other supported language —
replace the keywords with their translated equivalents using
enide [language]-d.
Installation
After installing ENIDE, get ready your setup with four quick steps.
Check the version
v1.0.0
Find your language
ENIDE supports dozens of human languages. List them all to find yours.
Get help of commands by your language
Replace english with your language name to see
all available commands.
Install "enide-dev" our official visual studio code extension (recommended)
"enide-dev" is supported with: Syntax highlighting , Run button and enide icon in .nd files .
First Program
Every ENIDE file must start with an
#include declaration this keyword must be by your your language.
After that, write your program, Replace english with your language name and run it.
.nd#include<english.lang>;
print("Hello, world!");
Hello, world!
#include is required for all enide program.
It stays if you don't include #include in your program.
The ENIDE interpreter will not get all the keywords by your language.
Includes
Includes load a language pack or a library. They must appear at the top of the file, before any other code.
Syntax
.nd#include<name.extension>;
| Extension | Purpose | Example |
|---|---|---|
| .lang | Language pack — required in every file | #include<english.lang>; |
| .lib | Standard library (math, date, etc.) | #include<math.lib>; |
.nd#include<english.lang>;
#include<math.lib>;
print(Sqrt(144)); /* 12 */
Data Types
ENIDE has five types. Every variable must be declared with a type and must always be initialised — declaration without a value is not allowed.
All variables must be initialised at declaration.
Writing number age; without a value is a syntax
error. Always provide an initial value:
number age = 0;
Variables
Declaration and assignment
.nd#include<english.lang>;
string name = "claudio";
number age = 16;
bool adult = false;
print("I am", name, "and I am", age, "years old");
Updating a variable
.nd#include<english.lang>;
number score = 0;
score = 10; /* assign */
score += 5; /* add */
score -= 2; /* subtract */
score *= 3; /* multiply */
score /= 2; /* divide */
score %= 4; /* remainder */
print(score); /* 3.5 */
Arrays
An array holds an ordered list of values. Declare with
[] and access elements by index starting at
0.
.nd#include<english.lang>;
/* Declare with initial values */
string fruits = ["apple", "banana", "cherry"];
/* Declare empty, fill later */
number scores = [];
for(number i = 0, i < 3, i++) {
print("Enter score", i + 1, ":");
scan(number, scores[i]);
}
/* Access by index */
print(fruits[0]); /* apple */
print(scores[2]); /* third score */
Is not supported object in array.
Writing string persons = [{...}]; is a syntax error.
Objects
An object groups related variables under a single name. Access properties with a dot.
.nd#include<english.lang>;
object person = {
string name = "claudio";
number age = 16;
bool adult = false;
string langs = ["pt", "en"];
}
print("Name:", person.name);
print("Age:", person.age);
print("Adult:", person.adult);
Conditionals
if / else if / else
.nd#include<english.lang>;
number score = 72;
if(score >= 90) {
print("Grade: A");
} else if(score >= 75) {
print("Grade: B");
} else if(score >= 60) {
print("Grade: C");
} else {
print("Grade: F");
}
Switch / Case
Use switch when testing a single variable against
multiple exact values. default runs when no case
matches.
.nd#include<english.lang>;
number day = 3;
switch(day) {
case(1) { print("Monday"); }
case(2) { print("Tuesday"); }
case(3) { print("Wednesday"); }
case(4) { print("Thursday"); }
case(5) { print("Friday"); }
case(6) { print("Saturday"); }
case(7) { print("Sunday"); }
default { print("Invalid Day of the week"); }
}
| Block | When it runs |
|---|---|
| case | if controlling expression match with the parameter passed will run, the case block code |
| default | Run the block if controlling expression does not match with any case. |
Loops
for— known number of iterations
The for loop takes three arguments:
initialisation, condition, and
update, separated by commas.
.nd#include<english.lang>;
for(number i = 1, i <= 5, i++) {
print(i);
}
/* Output: 1 2 3 4 5 */
while — condition-based iteration
Use while when the number of iterations is not known in
advance.
.nd#include<english.lang>;
number index = 0;
while(index < 5) {
print(index);
index += 1;
}
/* Output: 0 1 2 3 4 */
Always make sure the loop condition eventually becomes
false. Forgetting to update the counter (e.g.
index += 1) creates an infinite loop.
Exceptions
Use try / catch / finally to handle runtime errors
gracefully. The finally block always runs, even if an
error occurred.
.nd#include<english.lang>;
try {
print("Trying...");
/* code that might fail */
} catch {
print("Something went wrong.");
} finally {
print("This always runs.");
}
| Block | When it runs |
|---|---|
| try | Always — contains the code to attempt |
| catch | Only when an error occurs inside try |
| finally | Always — regardless of success or failure |
Functions
Functions group reusable logic under a name. Parameters are declared
with their types, and functions can return a value with
return.
Function without return value
.nd#include<english.lang>;
function greet(string name, number age) {
print("Hi, I am", name, "and I am", age, "years old");
}
greet("claudio", 16);
greet("euclides", 29);
Function with return value
.nd#include<english.lang>;
function add(number a, number b) {
return(a + b);
}
function isAdult(number age) {
return(age >= 18);
}
print(add(3, 7)); /* 10 */
print(isAdult(16)); /* false */
print(isAdult(29)); /* true */
Libraries
Libraries extend ENIDE with additional functions. Include them at the top of your file alongside the language pack.
math.lib
.nd#include<english.lang>;
#include<math.lib>;
print(Sqrt(100)); /* 10 */
print(Max(4, 9)); /* 9 */
print(Min(4, 9)); /* 4 */
print(PI); /* 3.14159... */
Use enide english-d (or your language) in the
terminal to see the full list of available functions for each
library.
Operators
Arithmetic
| Operator | Meaning |
|---|---|
| + | Addition |
| - | Subtraction |
| * | Multiplication |
| / | Division |
| % | Remainder (modulo) |
| ** | Exponentiation |
| ++ | Increment by 1 |
| -- | Decrement by 1 |
Comparison
| Operator | Meaning |
|---|---|
| === | Equal with the same type |
| == | Equal |
| != | Not equal |
| !== | Strict not equal |
| > | Greater than |
| < | Less than |
| >= | Greater or equal |
| <= | Less or equal |
Logical
| Operator | Meaning | Example |
|---|---|---|
| && | AND — both must be true | age > 0 && age < 120 |
| || | OR — at least one must be true | x == 0 || x == 1 |
| ! | NOT — inverts the value | !adult |
CLI Commands
All ENIDE functionality is accessible from the terminal. Replace
english with your language name where applicable.
| Command | Description |
|---|---|
| enide version | Show the installed ENIDE version |
| enide languages | List all supported human languages |
| enide file.nd | Execute an ENIDE program |
| enide english-h | Show all commands translated to English |
| enide english-d | Show full translated documentation |
The suffix -h and -d follow the
language name. For Portuguese it would be
enide portugues-h; for Spanish,
enide espanol-h.