class Cat {
string name = "Unnamed";
int age = 0;
void introduce() {
print("Hi! My name is " + name);
print("I am " + string(age) + " years old.");
}
}
Cat gato = new Cat;
gato.name = "Gato";
gato.age = 3;
gato.introduce();
GatoLang
A simple, fast, familiar language.
About GatoLang
GatoLang is a simple, fast, compiled language with a clean and compact syntax. It compiles to C code, which is then compiled to native binaries using GCC or Clang. GatoLang is designed for ease of use, performance, and safety, making it a great choice for beginners and experienced developers alike. GatoLang also recently became a language supported by Atlas.
string[] languages = ["GatoLang", "C", "Assembly", "Lua"];
loop(int i : languages.length) {
print("Language: " + languages[i]);
}
loop(3) {
print("Hello, world!");
}
Arrays and Loops
@header {
#include <math.h>
#include <stdio.h>
}
float number = 25.0;
float result = 0.0;
@{
result = sqrt(number);
}
print("GatoLang says:");
print(result);
@{
printf("C printf says: %f\n", result);
}