Happy Halloween!
Version 2.10
Version 2.10 is here.
This new version includes the first, fully functional Sidef-to-Perl code generator, which replaces the traditional way of interpreting the code (which was by walking the AST).
Instead, we now deparse the AST into an equivalent Perl program, after which we evaluate it. This technique improves the overall run-time performance of Sidef by, at least, 500% (yes, that's correct), and even more in some places such as recursion, looping and method invocations.
In this process many new features had been added to the language, while some old features (not many) are gone.
What's new
- All functions and methods are now closures. (https://github.com/trizen/sidef2/commit/00c22a8e6d5c4f035e5763752c3dd127819bd1b0)
- The
goto
keyword and support for labels. (https://github.com/trizen/sidef2/commit/bcb497366e9ab48a68d1ca13a8132c005f8b0f94) - Support for global variables (https://github.com/trizen/sidef2/commit/f63f2ff22c5b6d3450d7614664d81c9f28f65c69)
- Localization support for magic variables (https://github.com/trizen/sidef2/commit/c9425fe93dc613e00e1150665b67c1814282685d)
- Support for real-constants (https://github.com/trizen/sidef2/commit/60e5b950bf98f71e4a527a41d703bbf45a943c92)
- Support for
do {...} while (expr)
support. (https://github.com/trizen/sidef2/commit/612039ff45780f1805e0f9e23dc27599cd4ae874) - The infix keywords
if
andwhile
(https://github.com/trizen/sidef2/commit/93bfce7d4ce0bc01742afefb2f70131790495e37) - The
Grapheme
andGraphemes
built-in types (https://github.com/trizen/sidef2/commit/915c57f82755f95aea8d41d8451e0914e54fb3dd) - Traits for functions and methods (https://github.com/trizen/sidef2/commit/a4f6f2bff63d6e5b5ebfd75c0c03250f0275a08c)
- The
Array.sort_by {...}
method (0687ff3) - Prefix and postfix dereference (https://github.com/trizen/sidef2/commit/a411e8fd4a5a8b376c9b30d61c09fee4fe8f4618 https://github.com/trizen/sidef2/commit/48b31c887796a24b6b4e982da9ae4e5cb5ce0f68)
Improvements
- Better support for structures (
struct Name { ... }
) (a353469) - More constants can now be declared at once (https://github.com/trizen/sidef2/commit/b169b7404a00a3ac4fe54b35953eca9dfa884b16)
- Stricter rules for comparison operators (https://github.com/trizen/sidef2/commit/428b1af7ca48ce177b98520046f9959eafe4adda)
- Optimized the
Array.uniq
andArray.last_uniq
methods (https://github.com/trizen/sidef2/commit/bd165288d5e8953d36ec847d7fd8211bb039e4a1) - Slurpy parameters now support default values (7bdfafe)
- Better type-checking for typed parameters (ad1f961)
- Better support for named parameters (8097b21)
- Better support for declaration of variables with default values (5952210)
- Method calls can now expand on multiple lines (c1dc82f)
eval()
is considerably faster now (https://github.com/trizen/sidef2/commit/9a965f0629bfa1db79f1077cb1c0d57058e0561c)
Changes
- Semicolons are now fully optional. (https://github.com/trizen/sidef2/commit/612039ff45780f1805e0f9e23dc27599cd4ae874)
- The regex variables (
$1
,$2
,...
) are gone. (1eaf761) - Removed the triple-equal (
===
) operator. (https://github.com/trizen/sidef2/commit/349b25969b1d73c106067801d7f41deb3eddc3c4) - Removed the support for class
def
variables. (https://github.com/trizen/sidef2/commit/c95f6a17ca5a9aa5bf53ea12baffcc0d081ef7be)
Bug-fixes
- The
gather/take
construct is now recursion-friendly. (https://github.com/trizen/sidef2/commit/763f9edab372147b95669ea73e7c93cbab9ffe7f)
Known issues
break(n)
andnext(n)
no longer work (usegoto
instead).- The support for multiple dispatch is currently unimplemented.