Changes for version 26.08 - 2026-08-07
- BREAKING CHANGES
- Regex union (`|`) operator now performs alternation instead of concatenation. `/foo/ | /bar/` now produces `/foo|bar/` rather than `/foobar/`. Code relying on the previous behavior must be updated.
- ADDED
- solve_pell(D, N=1) full LMM solver returning all fundamental solutions and supporting gcd(D,N) != 1
- solve_quadratic_form(a,b,c,n) extended to non-positive discriminants
- solve_binary_quadratic_form(...) extended to non-positive discriminants
- solve_ternary_quadratic_form(...) extended to non-positive discriminants
- reduce_quadratic_form(A,B,C) Gauss reduction of positive definite binary quadratic forms
- coredisc(n) fundamental discriminant of Q(sqrt(n))
- dedekind_sum(h,k) Dedekind sums
- hilbert(a,b,p) Hilbert symbols
- ellcard(A,B,p) elliptic curve point count over F_p
- Polynomial.roots_mod(f,m) solve polynomial congruences modulo m
- solve_cubic_mod(A,B,C,D,m) modular cubic solver
- is_zumkeller(n)
- is_weird(n)
- is_pseudoperfect(n)
- is_smith(n, base=10)
- sum_of_cubes(n)
- difference_of_cubes(n)
- zeckendorf(n)
- fibonacci_inverse(n)
- primitive_pythagorean_triples(limit)
- frobenius_number(a,b,...)
- eulerian(n,k)
- partition_count(n) now accepts an optional number of parts or a custom part-set.
- antidivisor_sigma(n,k=1) and bphi(n,k=1) generalized with an optional k parameter.
- utils/make_pod2pdf.pl utility for generating PDF documentation from POD.
- FIXES
- rootmod_all no longer mutates its arguments for non-native integers.
- Fixed File.abs2rel, change_time_days_diff, access_time_days_diff, and modification_time_days_diff.
- Fixed FileHandle.read_byte handling of embedded null bytes.
- Sys.readln and Sys.read in the REPL no longer create multiple Term::ReadLine instances.
- Dir.find no longer changes the current working directory while iterating, allowing file tests such as is_file to behave correctly.
- Sys.select now returns the previously-selected filehandle as a Sidef FileHandle object.
- FUNCTIONALITY AND PERFORMANCE
- Added optional PARI/GP backend for expensive number-theoretic routines. Large inputs to znlog, hclassno, solve_pell, ramanujan_tau, Chebyshev polynomials, Hermite polynomials, Laguerre polynomials, and very large integer factorization can now be substantially faster.
- PARI/GP is accessed through a persistent IPC::Open2 pipe, significantly reducing repeated invocation overhead.
- Reimplemented PolyMod.factor_exp using GMPz. Besides being much faster, this also accelerates Polynomial.roots_mod and solve_cubic_mod.
- Reimplemented linear_congruence using GMPz.
- Much faster fibmod, fibonacci(k-th order), and fubini for large inputs.
- RangeNumber.iter reimplemented for approximately 10-20% higher performance.
- Faster is_pandigital for bases below 64 and for very large inputs.
- Optimized digits, sumdigits, and digits2num for large bases.
- bphi is approximately twice as fast.
- Added FIFO caches for _factor, _factor_exp, _divisors, and _is_prob_prime on non-native integers.
- Number constants (such as Num.pi) are now cached per precision.
- Replaced dynamic operator dispatch with a precomputed dispatch table, improving performance across core arithmetic operators.
- Introduced a reusable Number object pool to reduce allocation overhead in of{}, times{}, and integer construction.
- Faster min, max, gcd, and lcm when operating on many native integer arguments.
- DOCUMENTATION
- Reorganized nearly all core POD documentation into topical sections, expanded examples, and synchronized documentation with implementation.
- Word-unwrapped POD sources so perldoc and man handle wrapping naturally.
- Expanded and polished NUMBER_THEORY_CHEATSHEET.md.
Documentation
The Sidef Programming Language interpreter
Modules
The Sidef programming language
Deparse Sidef AST to Perl source code
Deparse Sidef abstract syntax trees back into Sidef source code
Mathematical functions and algorithms for Sidef
Functional interface for Perl modules used from Sidef
Object-oriented interface for Perl modules used from Sidef
Type conversion methods for Sidef objects
Lazy iterator object for generating and processing custom sequences.
Lazy evaluation wrapper that computes values only when needed.
Deferred, chainable method calls.
Base class providing the common interface for all Sidef objects.
AST optimization and constant folding for Sidef programs
Parser for the Sidef programming language
Signal handling interface for Sidef
System-level operations and utilities
Date and time object with parsing, formatting, arithmetic, and calendar operations.
Representation of time as Unix epoch seconds
Dynamic ordered collection with rich functional, numeric, and utility methods.
Mathematical matrix operations in Sidef
Two-element key-value pair object used throughout the language.
Mathematical vector operations in Sidef
Executable code block (closure) with lexical scope and callable behavior.
Fork object for parallel process execution
Exception handling block in Sidef
Boolean value type supporting logical operations and conversions.
Shell command execution via backticks
Directory manipulation and navigation in Sidef
Directory handle object for iterating and manipulating directories.
File manipulation and information retrieval
File handle object for reading, writing, and managing files.
Interface for creating and managing pipe handles
Socket networking interface for Sidef
An open socket connection, for network communication
File status information interface
Associative hash table mapping keys to values with convenient collection methods.
The Null type in Sidef
Arbitrary-precision complex number type with advanced mathematical operations.
A ratio of two numeric (or symbolic) values.
Gaussian integer arithmetic in Sidef
Modular arithmetic in Sidef
Arbitrary-precision numeric type providing extensive mathematical and number-theoretic functionality.
Polynomial type supporting symbolic manipulation and algebraic operations.
Polynomial type over finite rings with modular arithmetic operations.
Elements of a quadratic ring Z[t] / (t^2 - q*t - p)
Quaternion number implementation
Bridge for evaluating Perl code within Sidef
Range class for representing sequences of values
Numeric range object supporting iteration, slicing, and lazy sequences.
String range objects for iteration and manipulation
Regular expression match object exposing captures and match metadata.
Regular expression type for pattern matching, searching, and text substitution.
A multiset (bag) data structure for Sidef
Unordered collection of unique elements supporting mathematical set operations.
Unicode string type with comprehensive text processing and manipulation methods.
Command-line argument parsing for Sidef's MAIN function
Represents a named parameter used in function and method calls.