JAI (programming language)
Redirect page
Redirect to:
Introduction
JAI | |
---|---|
Paradigm | Imperative (procedural), structured |
Designed by | Jonathan Blow |
Typing discipline | Static |
OS | Cross-platform |
Filename extensions | .jai |
Influenced by | |
C++ |
JAI is a programming language that is intended to replace C++ for the development of high-performance video games and complex simulations. The language is being developed by Jonathan Blow and members of his company Thekla inc. The language is not available to the general public yet. The author sometimes streams the development of the language and of the game his company is currently working on, which is being implemented in the new language. At the time of writing the compiler is still written in C++, but the plan is to write it in JAI itself.
The actual pronunciation of "JAI" is up for debate, the author seeming to ignore any questions about the name or its pronunciation. It is not clear if it is the name that is intended to be used 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, strictly procedural, compiled language similar to C/C++. The similarities with C++ mostly stop there, however. In the beginning, the design of JAI has been purposely restricted in scope in order to reduce the complexity of the language. Some of the more notable features include type inference, no header files, and arbitrary compile-time code execution for metaprogramming.
Among the language, goals are a fast compilation, highly optimized machine code production, and programmer enjoyment. These requirements come from the author's experience writing games in C++. He has stated that he is far more productive when programming is enjoyable.
In the beginning, in order to minimize compilation time during development, the compiler has the ability to emit poorly optimized x64 assembly code very quickly. When the 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 comes from a video post by the author on YouTube entitled "Ideas about a new programming language for games", posted on September 19, 2014. At the time it seemed only an open discussion, without no intention of actually implementing a new language. A few weeks later the author 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.
Till then the author continued to develop the language, hosting twitch streams 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, it was announced that the current compiler was released to a business partner for evaluation purposes. Maybe a company interested in writing some editor, debugger or other RAD tools for the language.
Syntax
The author 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 terminate 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;
.