Full BEDMAS support has been implemented in the new compiler for the ‘i’ programming language.
This is a pretty basic feature of a programing language, however, due to the way I created the first two compilers, BEDMAS support was rather hit and miss. Recursion is not a strong skill of mine.
For those not familiar with BEDMAS (aka. operator Precedence). It is the standard way of evaluating a mathematical expression. The acronym stands for “Brackets, Exponents, Division, Multiplication, Addition and Subtraction”. This acronym is a common way for people to remember the order that they evaluate mathematical statements such as “2*3+5” which is equal to “11” and not “16”.
On another new rather ‘surprising’ note, the new ‘i’ compiler runs faster than the ‘Go’ language it is compiling to.
I wrote a Hello World program that loops a million times (To be fair, this is not a great benchmark).
The ‘i’ code is ~100ms faster than an idiomatic version in Go.
Keep in mind that the ‘i’ code has been translated into Go in order to run --- so this is a rather surprising result!
This can mean only good things for the future of ‘i’.