Jump to content

JAI (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by JonasVonKanada (talk | contribs) at 21:27, 5 November 2019 (Rough first draft, needs lots and lots of work). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Redirect page

JAI is a programming language that is intended to replace C++ for high performance video game programing. The language is being developed by Jonathan Blow and members of his company. The language is not available to the general public yet. Blow often live streams development of the language and the game he his company is currently working on which is being implemented in the new language.

The actual pronunciation of "JAI" is up for debate, with Jon seeming to ignore any questions about the name or it's pronunciation. It is not clear if it is the name that Jon intends to use for the language or if it is just the file extension, with the name of the language itself being something different.

Overview

JAI is a statically typed, compiled language just like the language it is intended to replace. The similarities with C++ mostly stop there however. The design of JAI has been purposely restricted in scope in order to reduce the complexity of the language. It's more notable features include, type inference, no header files, and arbitrary compile time code execution.

Among the language goals are fast compilation, performant code, and programmer enjoyment. These requirements come from Blow's experience writing games in C++. He has stated that he is far more productive when programming is enjoyable.

In order to minimize compilation time during development the compiler has the ability to emit poorly optimized x64 assembly code very quickly. When maximum performance of generated code is desired the LLVM back end is used to produce optimized code.

History

The earliest history available about the language come from a video post by Jon on YouTube entitled "Ideas about a new programming language for games.", posted on September 19, 2014. At this time it appears that Jon had no intentions of actually implementing a new language. A few works later Jon presented a demo of the language. At this stage the language was being implemented by first generating C source code that was then itself compiled, much the same as early C++ compilers operated. Even at this early date, key features of the language were present, such as compile time code execution.

Jonathon continued to develop the language, hosting twitch streams and and posting progress reports on YouTube. He has kept the language and source restricted to his company during development with plans to release it to the wider public once the compiler had been moved into a more robust state.

In a tweet posted on November 1, 2019 Jon announced that he had released the compiler to an unknown number of people outside the company.

Syntax

Blow has stated during his Twitch streams that the syntax has not been finalized and is open to altering it in the future. The syntax of JAI is broadly derived from C++ and therefore C syntax. Blocks are delineated by curly brackets, and semicolons are required to terminated a statement.

Variable Declaration

The name of a variable is written first, followed by the type, separated by a colon. If the variable is to be initialized explicitly then an assignment can follow. a: int = 0;

Because of JAI's type inference feature often times the type of a declaration can be omitted. The previous example could just as validly be written as a := 0;.