When calling empty dict() or list(), will generate a empty dictionary or list instead:
x = dict() --> x = {}
y = list() --> y = []
Loops which call only one function on a iteration now transform into maps:
loop 12 i to func
Turns into:
list(map(func, range(12)))
The list function is needed in order to actually execute the function calls.
For loops appending to lists while calling a function now transform into maps:
for x in thing: myList.append(func(x))
Turns into:
y = list(map(func, thing))
Pure functions now receive a (depending on python version) @cache or @lru_cache decorator which provides a great speedup to that function.
A silly but real bool optimization trick:
not not var
Is faster than:
bool(var)
So it replaces that instance. Also works with pipes.
Accepts hexadecimal numbers more properly
is syntax now correctly triggers len function when comparing string and int
Builtin Python functions will now call without ()
Can use type declaration and const syntax in either order.
const int num 12
# acts the same as
int const num 12
When using a increment/decrement on a while loop, var++ will apply at the end of a iteration, and ++var will apply at the start of an iteration.
Can specify which Python version to compile to via Meta instead of compiler flag:
$ pythonVersion = 3.7
Use multiple times to create sections of the code that compile to different versions.
This version of ASnake is the first to go open source. While few have contributed, it has meant that at least sometimes people use it, and thus rely on it. That has created some good habits to increase stability, and hence the amount of commits for this version. However, I must move on and introduce more features to the language, increasing the reasons anyone should care about it all. In the next release I plan on implementing:
The next release will be ASnake v0.12.0+