Glava

Glava is an esoteric programming language, built on top of a Java base, that is designed to be effective in code golf competitions. It was designed and implemented by ZekNikZ in 2017.

Glava is not designed to be a separate language from Java, it is purely designed as a shorter, more feature-rich version. This includes a custom code page which allows all characters to be a single byte.

Features Shorthands

Shorthands are single- or double-character shortcuts that are replaced by longer strings. Shorthands are what give Glava much of its power.

Type Shorthands

Type Keywords

  →  

 →  

 →  

 →  

 →   

Type Classes

  →  

 →  </li>

 →  </li>

 →  </li>

 →  </li>

 →  </li> </ul>

<h4 id="typeclasseswnewkeyword">Type Classes w/  Keyword

  →   *</li>

 →   *</li>

 →   *</li>

 →   *</li>

 →   *</li>

 →   *</li> </ul>

Casting

  →  </li>

 →  </li>

 →  </li>

 →  </li>

<li> →  </li>

<li> →  </li> </ul>

Loop Shorthands

<ul> <li> →   closing character adds  *</li>

<li> →   (infinite   loop) *</li>

<li> →   closing character adds  *</li>

<li> →   (pre-built   loop) closing character adds  *</li> </ul>

<h3 id="commandlinearguments">Command-line Arguments

<h4 id="stringarguments">String Arguments

<ul> <li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li> </ul>

<h4 id="convertedarguments">Converted Arguments

The shorthands  are replaced with their corresponding command-line arguments, after attempting to convert them to another native type. For example, if the first argument is,   will be replaced with   in the code.

<h4 id="convertedargumentsarrays">Converted Arguments Arrays

All of these arrays contain only the command-line arguments of that type.

<ul> <li> →   *</li>

<li> →   *</li>

<li> →   *</li>

<li> →   *</li>

<li> →   *</li>

<li> →   *</li> </ul>

Output

<ul> <li> →   *</li>

<li> →   *</li>

<li> →   *</li> </ul>

Misc

<ul> <li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →  </li>

<li> →   (also a group closer)</li> </ul>

* This shorthand opens a group.

<h2 id="automaticcodecompletion">Automatic Code-Completion

Glava has the great feature of being able to auto-complete many parts of your code.

<h3 id="automaticgroupclosing">Automatic Group Closing

If, throughout your code, you open any groups (, ,  , etc.) but never close them, Glava will close them automatically when compiling. Note that this does not work the other way around.

Example:  will be closed by , and then by.

<h3 id="automaticmainmethodandclasswrapping">Automatic  Method and   Wrapping

Glava also has the ability to wrap your entire code in a  method, assuming it does not have one. And then, if it does not have a surrounding, it will wrap the code in.

Additionally, if Glava wraps the code in a, several other features are added as well. All of the following are added into/around the    as well:

Default Imports

<ul> <li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li> </ul>

<h4 id="defaultclassstaticvariables">Default Class (Static) Variables

<ul> <li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li> </ul>

<h4 id="commandlineconvertedargumentarrays">Command-line Converted Argument Arrays

Note: only the applicable arrays are created when the program is run. Also, note that all of these arrays also have shorthands.

<ul> <li> </li>

<li> </li>

<li> </li>

<li> </li>

<li> </li> </ul>

<h2 id="miscellaneousfeatures">Miscellaneous Features

On this wiki page you can find a list of all of the miscellaneous features of Glava that do not fit in another category.

<h3 id="multilinestrings">Multi-line Strings

Instead of using  for linefeed characters in strings, in Glava, you can use literal linefeeds.

<h3 id="shortercharliterals">Shorter  Literals

Not as important, but all char literals in  no longer use and ending single quote (  is a   literal in Glava but   is not).

Custom Code Page

To be able to use more characters in programs, Glava has a custom code page which can be found here.

Examples Hello, World! λ"Hello, World!

FizzBuzz λ(①%3<1?"Fizz":s)+(①%5<1?"Buzz":①%3<1?s:①

99 Bottles of Beer n=99;A=new String[]{" bottles of beer on the wall"," bottles of beer. Take one down, pass it around, ","Better go to the store and buy some more."ώwhile(n>0){λn+A[0]+", "+n+A[1]+(--n)+A[0]+". ");}λA[2]

External Resources <ul> <li> Source Code</li> </ul>