Skip to content

Releases: trizen/sidef

Happy new year!

02 Jan 10:52
Compare
Choose a tag to compare

Version 2.20

New year, new approaches, new experiments!

I'm very happy to announce today the release of Sidef 2.20, which includes a very important change in the core of the language, namely the transition from Math::Big{Float,Int,Rat} to Math::{MPFR,MPC,GMPz,GMPq}, which makes Sidef about 6x faster and much more reliable for numerical computations.

Happy new year!

What's new

  • Switched from Math::Big{Float,Int,Rat} to Math::{MPFR,MPC,GMPz,GMPq} (445a699)
  • Added support for initialization of numbers in different bases (from 2 to 36) (dec506c)
  • Complex numbers and real numbers are now blended together (1a507bb)
  • Added the Inf and -Inf keywords to represent positive and negative infinity
  • Added the NaN keyword to represent the Not a Number value (be1542b)
  • New methods inside the Number class, such as: fib, gamma, is_prime, primorial, etc...
  • Added the with(expr){...} statement, similar to that from Perl 6 (bd8c1da)
  • Added support for Unicode symbols in Math constants, such as Math::π (d67be5d)
  • Added the Number.base(n) method to return a number in a given base (33df118)
  • Added a new syntax for changing or declaring class variables (Class!name) (a86d4cb)

Improvements

  • Better support for Complex numbers (b6ed0b9 0c85c73)
  • Extended the support for ranges with floating-point numbers (2faee2a)
  • Better stringification of numbers (e.g.: (100! + 1) / 2 will display the exact result) (a86d4cb)

Changes

  • Removed the Byte(s), Char(s) and Graph(s) built-in types (445a699)
  • Changed the behavior of // operator to mean integer division (d4199ad)
  • Redefined the behavior for Inf**0 to return 1, instead of NaN (b9fc23f)

Bug-fixes

  • Fixed the String.count(regex) method to return correctly the number of matches (8affc32)

More changes: 2.13...2.20

Version 2.13

24 Dec 09:00
Compare
Choose a tag to compare

Speed, speed and more speed. This version incorporates many performance improvements and several bug-fixes.

What's new

  • Auto evaluation-conversion for lazy-methods (ef52c90)
  • Added the Number.modinv() method (b049eb0)
  • Added the Object.bless method to return a blessed object in the self class (0603970)
  • Added the Array.each_slice(n, {...}) method (5e94052)
  • Added the Array.each_cons(n, {...}) method (203ce65)
  • Added experimental support for changing the global precision and accuracy of numbers (8157b53)

Improvements

  • Optimized all the op-assign operators, such as +=, -=, etc... (2dd3ec7)
  • Simplified the code used in calling subroutines from Perl modules (0b786ec)
  • Improved the support for autovivification (4455a3f)
  • String.first() and String.last() will now accept a number as an argument (801ff02)
  • Optimized the String.match() and String.gmatch() methods (31f81c4)
  • Better dumping of regular expressions (32262a1)
  • Pair.first and Pair.second are now lvalues (93af122)
  • Optimized and improved the Array.combinations() method (be956e5)
  • Better translation of certain expressions (1e2133f)
  • Faster translation of strings with code-points between 127 and 255 (e7c3756)
  • Array.ft(from, to) is now considerably faster (3a127a8)
  • Minor performance improvement in stringification of Boolean values (0968745)

Changes

  • Renamed the built-in object SIG to Sig (42a1483)
  • Renamed Array.each_with_index{} to Array.each_kv{} (0cc0dcf)
  • Renamed Array.reduce_pairs{} to Array.pairmap{} (ce2fc7b)
  • Blocks will always be called as blocks, and never as functions (782e847)
  • In list assignments, the last lvalue is now returned (160c97b)
  • Unary operator - will now call the neg method, instead of negate (0621e50)
  • Number.range() with only one argument is no longer inclusive (6bc3074)

Bug-fixes

  • The __BLOCK__ keyword is now translated correctly as a block (572cabb)
  • Fixed the -c command-line switch to work when Sidef is installed (8b8c966)
  • Fixed the Convert.to_f() method to work with rational numbers (a07896d)
  • Flat lists as array indices will work as expected (5fa3c64)

More changes: 2.12...2.13

Version 2.12

10 Dec 23:29
Compare
Choose a tag to compare

The multiple dispatch is back!

In addition, this release includes support for functional pattern matching, various optimizations, improvements and several bug-fixes.

What's new

  • Support for multiple dispatch (ab914f8)
  • Support for functional pattern matching (e756b97)
  • Support for class attributes with the has keyword. (7de49f0)
  • Auto-conversion of arguments from Perl callback functions (8c7debc)
  • Added the Array.last_by{} method (423f190)
  • Added the -k switch to keep track of potential unsafe interpretations (e31de40)
  • Added the Array.dig() and Hash.dig() methods (6ce5ad5)
  • Added the ... prefix operator to represent unimplemented code (b1604b3)
  • Added the Array.freq() and the Hash.map{} methods (ae25298)
  • Added the String.numbers and String.each_number{} methods (1f7991d)
  • Added the Hash.count{} method (59b595d)
  • Added the Bool.pick method which randomly returns true or false (d71f860)
  • Added the following Complex methods: root, roots, polars and reals (501b714 26f78d4)

Improvements

  • Optimized the prefix and postfix ++ and -- operators (ab914f8)
  • The operator != is slightly faster now (84483ef)
  • Improved the assertions to include the actual values (d584e60)
  • Improved the given/when construct (e9f70c7)
  • All the meta-objects are created directly inside the parser (80bae2e)
  • Better localization of the topic variable (_) (c723701 6c45643)

Bug-fixes

  • Array.rotate will always return a new array (606c837)
  • Fixed the deparsing of the bare Block keyword (754f102)
  • Deparsing code to Perl (with -Rperl) will now include binmode(STD*, ':utf8') (4a9ebf1)

More changes: 2.11...2.12

Version 2.11

24 Nov 18:24
Compare
Choose a tag to compare

This version is a minor release which fixes some issues from 2.10 and brings in some new features and improvements.

What's new

  • Added the for var in array {...} construct, to iterate over an array (436a730)
  • Added the cross (~X) and zip (~Z) meta-operators from Perl 6 (22f950b)
  • Added support for checking multiple return-types. (9998e5c)
  • Added the rational-division operator (//) which creates a Math::BigRat object (2eac143)
  • Added the Array.map_with_index{} method (3ae5182)
  • Added the String.prepend() which adds a sub-string in front of the self string. (6f5fefb)
  • Added the Array.fetch() and Hash.fetch() methods to fetch a value with a default value (5edff8a)

Improvements

  • All variables are now block-scoped, instead of function-scoped. (3507cad)
  • Simplified and improved the local variables (4409629)
  • Extended the String.contains() method to support regular expressions. (87b8a4a)
  • Memoization of functions and methods is considerably faster. (6059550)
  • Array.sum() and Array.prod() will accept an argument as a starting value (775fe8f)
  • Generalized the Array.index() and Array.rindex() to work with objects of any type (d9b1608)
  • Optimized the Array.rotate() method (b73f61a)
  • Improved the support for assertions to display exactly where the assertion failed (0350534)
  • die and warn keywords will now display the file and the line number (8710936)
  • Improved greatly the -O1 optimization level to cover more constructs (b18f611 e3a1a1f)

Changes

  • Modified the read() built-in function to accept a message and a type. (de7537b)
  • do is no longer considered a keyword, unless it is followed by a pair of curly brackets.
  • Bare blocks can no longer be called with named parameters (3f492c1)

Bug-fixes

  • Minor bug-fix in deparsing block arguments with default values. (974f33d)
  • Minor bug-fix inside the parser regarding the declaration of variables (451f169)
  • nil values are now displayed correctly in interactive mode (-i) (adebde5)

More changes: 2.10...2.11

Happy Halloween!

31 Oct 06:58
Compare
Choose a tag to compare

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

Improvements

Changes

Bug-fixes

Known issues

  • break(n) and next(n) no longer work (use goto instead).
  • The support for multiple dispatch is currently unimplemented.

More changes:

Version 0.11 (EOL)

12 Oct 18:47
Compare
Choose a tag to compare

EOL

This is the latest version of Sidef which is interpreted by walking the AST. Future versions will include a code generator which will generate Perl code, improving greatly the run-time performance of Sidef.

Changes

  • Added experimental support for implicit block calls. (a0c1e81)
  • Added the Class.alias() method for creating aliases to methods. (3eea5a1)
  • Fixed the FileHandle.slurp() method to work with :utf8 layers in future versions of Perl. (f46fe9b)

More changes: 0.10...0.11-EOL

Version 0.10

16 Sep 22:55
Compare
Choose a tag to compare

What's new

  • Added the Block.all and Block.any methods (6a39c5b)
  • Added the Array.index and Array.rindex methods (6da2ce7)
  • Added the following String methods: bin, oct, num (98e7a11)
  • Added the Match.join method to join the captured matches (087c773)
  • Added support to assign a value to a reference without dereferencing (d475f33)
  • Added the ClassInit.method and ClassInit.invoke methods (7fd6816)
  • Added the Number.atan and Number.atan2 methods (fba18cc)
  • Added the Sys.wait, Sys.fork and Socket.socketpair methods (6617f38)
  • Added the Range.map method for number ranges (00fc434)

Improvements

  • Improved the -O3 optimization level (376d7bf, 72ca7d9)
  • Hash.copy and Array.copy are now much faster and safer (86d9350)
  • Extended the Hash.default method to accept a block of code. (4522d5b)
  • Extended the Hash.delete method to delete more than one key (8a17915)
  • Extended the Number.range method to accept a third parameter (fa009ac)
  • Extended the »op« hyper-operator to work with arrays of different sizes (3b8612a)
  • Extended the smartmatch operator (~~) to work with Range ~~ Obj (f45a4c7)
  • Extended the MultiArr object to work with arrays of different sizes (0f4f985)
  • Added auto-stringification for Match and Complex objects. (1428ebc 6dae437)

Changes

  • The output of backticks is no longer UTF-8 decoded (f369175)
  • Removed the camelCase method-aliases, along with other core changes (19ab31b)
  • Changed the given/when construct to use the smartmatch operator (ceecf82)

Bug-fixes

  • Fixed a critical bug related to the initialization of Math::BigFloat (9ee37d0)
  • Returned objects from module calls are now objectified correctly (43e1f00)
  • Fixed the Hash.flip method -- it works correctly now (86d9350)
  • %w(...) arrays are now created dynamically at run-time (8f6e9e7)
  • The unary operators ? and ! will now work correctly with overloaded objects (41f9013)

More changes: 0.09...0.10

Version 0.09

06 Sep 16:09
Compare
Choose a tag to compare

What's new

  • Added support for constant-folding (available at -O1) (cc439e4)
  • Added the map-operator from Perl6 (array »op» arg) (2023e2e)
  • Added the reversed map-operator (array «op« self) (04f8897)
  • Added the gather/take construct from Perl6. (#30) (b4e5de6)
  • Added the Range.reverse() method which reverses the self range (33a1ce8)
  • Added the Number.divides() method (80899b1)
  • Added the Block.closure alias for Block.copy (97bfe06)

Improvements

  • Extended the support for Unicode inside variable names (e9f427f)
  • Extended the Number.range() method to support two arguments (b95ac45)
  • Improved the Block.fork method; now it's much safer and faster (7923227)
  • Improved the parsing of here-documents declared with a bareword (8ab0b77)
  • Improved the Math.pi(n) method; now it's considerably faster for n>1000 (852c857)
  • Optimized the Number.array_to() and Number.array_downto() methods (964893a)
  • Various optimizations inside the parser (e689281 2023e2e 90df3cb)

Changes

  • Array.minmax now returns a list instead of an array (80899b1)
  • Renamed the my variables to local variables (7b47eee)
  • Simplified the internal implementation of ranges (33a1ce8)
  • Changed the behavior of the Math.map() function (ecc1e67)
  • A string can no longer match in a range of type number and vice versa (cfcc10e)
  • The hyper-operators will now require two angle-brackets in ASCII form (2023e2e)
  • Simplified the following Number methods: as_oct, as_hex and as_bin (148ecef)

Bug-fixes

  • Fixed the deparsing of infinite and NaN numbers (274a8db)
  • Fixed the command-line switch -nBACKEND to work correctly with Math::BigFloat and Math::BigRat objects (88d4728)

More changes: 0.08...0.09

Version 0.08

01 Aug 17:09
Compare
Choose a tag to compare

What's new

  • Generalized the syntax for prefix method calls. (3828759 3f119d9)
  • Added the Block.pfork method, which is a lightweight version of Block.fork (24e928e)
  • Added the String.looks_like_number() method and others (33bf066)
  • Added the -C command line switch to check the syntax of a program (a5332b0)
  • Added the assert, assert_eq and assert_ne built-in keywords. (354e22e)
  • Added the %s(...) and %S(...) quotes (f527e18)

Changes

  • Modules are now executed in reversed parse order (4bd4f97)
  • Simplified the internal object system, among other core changes (48c1f1f b4da2e2)
  • Number.divmod() and some other methods will return a list instead of an array (d0fdf0f)
  • Added srand() after each fork to re-seed the random number generator (8fdb831)
  • Changed the behavior of the smartmatch operator for String ~~ String (0322aab)

Bug-fixes

  • Fixed a stack bug for variables initialized inside the condition of a while loop (d7eb89e)
  • Fixed a bug related to overload stringification of various objects (814ae15)

More changes: 0.07...0.08

Version 0.07

07 Jul 22:55
Compare
Choose a tag to compare

What's new:

  • Added support for nexting two or more loops with next(n). (b9b242e)
  • Added the Array.each_index{...} method to iterate over the indices. (e950204)
  • Added the .dump method for user-defined classes. (758ab9c)
  • Added the Class.__class__ method to get the class of an object (502a5ec)
  • Added the FileHandle and DirHandle types. (5c80e36)
  • Added the .levenshtein method for String and Array objects. (f32aae1)
  • Added the .METHODS method for user-defined classes. (6122dd9)
  • Added the .method method for user-defined classes. (dbf29e5)

Improvements:

  • Improved the .METHODS method for built-in types. (aaa3382)
  • Array.count now accepts a block of code for counting items. (f32aae1)
  • Improved the parsing of classes and the parsing of return types from functions. (5c80e36)
  • Minor performance improvements. (46b5379, 1a44f27)

Changes:

  • Changed slightly the behavior of the smartmatch operator (~~) (b1d44e1)
  • Undefined method calls for user-defined classes are now fatal. (858420f)
  • File.<=> and File.cmp no longer refer to File.compare (e060408)
  • Removed the following operators: ??, $$ and ^^. (dad6bd3)
  • Merged the PipeHandle object into FileHandle. (5c80e36)
  • Renamed has_method into respond_to for user-defined classes. (dbf29e5)

Bug-fixes:

  • Fixed a minor bug related to array autovivification on slice creation. (3b7ee7e)
  • Minor fix for parsing type-constants. (966223c)

More changes: 0.06...0.07