Note: This is a April Fools’ Joke
Introduction
Nowadays, as most programming languages are built on top of English grammar and syntax, it is sometimes difficult for Latin, Spanish or French speakers to get used to the syntax in programming. Inspried by the type-safe
every modern language is persuing, here in HHS, we introduce another two new concepts for the ease for internationalization of a programming language: gender-safe and tense-safe for our new programming language Espaj!! Please read below for the cool features for Espaj:
Basic Syntax
As the name suggests, Espaj is similar to Java. It has a OOP structure and statements like if
for
idential to Java(or C++)’s. However, it introduces concepts like gender and tense to functions and classes.
Genders
Basic Concept
Each class now must be explicitly specified as masculine or feminine. When calling the functions, you must use corresponding masculine or feminine variants. Usually the rule is: -a
for feminine variants and -e
for masculine variants. Note: to fully distinguish variants, operators are not supported. You must use words to replace them.
Here are some genders for the basic types:
byte
: masculineshort
: feminineint
: masculinelong
: feminineshort
: femininedouble
: masculinechar
: feminineString
: masculineboolean
: feminineObject
: masculine
…
For example the following code in Java: if(number%2==0)
can be written into Espaj as:
if(number mode 2 equale 0)
if number is int orif(number moda 2 equala 0)
if number is long.
If you used the incorrect variants, you will be met with a Runtime Error. So be careful!
First-person Usage
When using this
as the object, you need to use first-person variants of the functions. Usually this is to add -o
for m and -oa
for f.
For example: this.equals(another)
can be written as this.equalo(another)
for m or this.equaloa(another)
for f.
Defining new classes
Now you need to specify the gender when creating a class:
1 | //it is male! |
Interfaces don’t have genders. :)
Defining new methods
Now when you define a function, the compiler will automatically create variants for you!
1 | //it is male! |
You can also specify special cases that do not apply the rule or opt-out several use cases:
1 | //it is male! |
So easy!!!
Static functions
Static methods are treated as feminine.
Gender Polymorphism
Gender polymorphism can be a bit tricky as functions should be used according to real type.
For example:
1 |
|
But we can use the new operator isMasculine
to check the gender of an object: if(a isMasculine)
or if(nota a isMasculine)
.
Genders for arrays and generics
Genders for arrays, lists, etc are just their underlying type.
When using generic, you can specify the gender-determining type using the gender
keyword and @VariableGender
annotation:
1 |
|
Genders for anonymous classes
It inherits its super class.
Tense
Basic Concepts
Calling methods should use their corresponding tense: present tense or future tense(lambda tense). This helps developers to distinguish different context.
Present tense
Present tense is used in normal functions.
Future tense
Future tense must be used when in a lambda. Usually it’s adding prefix fi-
to the method name. For example:
1 |
|
You can add annotations like @FFF
(first-person feminine future tense) to functions to add custom variants.
Other Forms
Polite Forms
In Japanese, we must be polite to our superiors. In Espaj, this is the same. When calling super
functions you must add -shimasu
(super is m) or -imasu
(super is f) after the base method name. When reading/writing super
attributes, you must add go-
before the variable name.
For example: super.barkshimasu()
/ super.barkimasu()
(for method bark) or super.goname
(for attribute name).
You can customize it with @PoliteFormM
and @PoliteFormF
Downloads and Installation
Now you have read about all features! So where can you get hands on this cool language? The language will be available for download on 2024.4.99!!
Thank you for reading!