langur

revision history

A full revision history is included in the download.

2024-07-25 - 0.17.1 - clean up code regarding arguments/parameters that are positional or by name - removed several fields from object.BuiltIn; using object.Signature for most - updated compiler and vm to allow "required by name" parameters (though not implemented in parser) 2024-07-23 - 0.17.0 - added optional parameters to compiled functions (not to be confused with parameter expansion, which is still positional) - changed how parameters/arguments are dealt with for compiled functions - changed OpClosure to OpFunction, with another operand to indicate a count for default values to be determined at run-time - updated lexer to allow number continuation on next line (see website for syntax) - added PreBuilder interface to ast, for times when a node can be converted directly to an Object, instead of making more instructions for the VM; added PreBuild() method to some node types

breaking changes

The current version of langur is very different than the one used in the book opCode v1 (which references langur 0.5).

0.17.0 does not allow a number literal to end with an underscore, since an underscore indicates that the literal continues on the next line.

0.16.7 updated impure module to require declaration as impure

0.16.6 changed scientific notation interpolation modifier to require 1. or 1, to start specified scale

0.16.5 changed negative number for rounding/truncation to indicate to work on the integer portion, rather than using negative number to indicate not to add trailing zeroes

0.16.5 changed interpolation modifier for scientific notation to use dash after scale to indicate to trim trailing zeroes on scale, rather than using a negative scale

0.16.5 changed interpolation modifiers for round and truncate to use dash after rather than before number to indicate to trim trailing zeroes

0.16.5 changed third argument of round(), moving mode to fourth argument

0.16.5 disallowed 0 as the integer portion on fixed point interpolation modifier (should be 1, not 0)

0.16.4 added carriage return (\r) to re2 free-spacing mode characters to skip

0.16.4 updated testing datetime truthiness to test for proleptic Gregorian in a time zone neutral manner (not dependent on time in UTC)

0.16.2 changed impure function declaration syntax from impure fn to fn*

0.16.2 changed function calling self syntax from self(x) to fn((x))

0.16.0 dropped variabledot syntax

0.16.0 changed parameter mutable/immutable syntax

0.16.0 limited unbounded argument lists to statement context

0.16.0 dropped use of assignment in switch test expressions

0.15.4 dropped math constant literals

0.15.3 changed truthiness of datetime values so that proleptic Gregorian dates (UTC) are false

0.15.1 removed index range by range

0.15.0 changed {{interpolation}} syntax; use ni modifier for non-interpolated string or regex; dropped old syntax

0.15.0 disallowed using {} as string quote markers, such as qs{} or re{}

0.15.0 disallowed token strings from being used as block markers

0.14.4 changed parsing functions with parenthesized parameters to require curly braces (long form)

0.14.4 changed datetime formatting variable (string) interpolation; dropped old syntax

0.14.4 dropped old custom function interpolation modifier syntax (deprecated in 0.14.3)

0.14.4 dropped using h token for hashes (deprecated in 0.14.3)

0.14.3 dropped testing list entries for sameness; now checks for equality

0.14.3 changed assignment in if tests to be declarations (not mere assignment)

0.14.2 dropped implied parameter functions

0.14.2 dropped using not as combination operator not=

0.14.2 dropped single letter tokens d, f, q, Q, w, W, x (deprecated in 0.14.1); instead use dr, fn, qs, QS, fw, FW, *

0.14.2 changed truthiness of functions (compiled and built-in) to reflect purity status

0.14.1 updated auto-stringification to only use on certain types (not on lists, hashes, etc.)

0.14.1 changed sleep() function to return a Boolean (false if value less than 1)

0.14.0 dropped matching against regex in swtich without explicit use of forward operator

0.14.0 dropped is and to functions; use type names and is and is not operators instead

0.14.0 dropped old syntax for explicit exception variable on catch; now uses square brackets to enclose, such as catch[.e]

0.13.9 dropped compiler flag -Wlookalike

0.13.8 updated lexing blockquotes to disallow use of ending marker followed other things on same line

0.13.6 dropped given keyword; use switch[and] instead

0.13.6 dropped arr() function; use list multiplication instead

0.13.6 changed truncate() to trunc()

0.13.5 changed isArray() to isList()

0.13.4 drops the X() function; use mapX(fn(... .x) .x, LISTS) instead

0.13.4 changed the cd() function to return the present working directory

0.13.1 changes default conversion of duration to string to include P

0.13.0 requires explicit declaration for impure functions. It also puts restrictions on their use. See the functions page for more details.

0.13.0 changes durations to both use their own token (not the date-time token) and makes them objects.

0.13.0 removes non-list functionality from gcd() and lcm()

0.12.7 changes the return value types on write(), writeln(), writeErr(), writelnErr()

0.12.7 drops deprecated execTh() syntax

0.12.6 changes the default "now" to not include nanoseconds

0.12.6 changes execTh() to execTH() and deprecates using execTh()

0.12.5 adds new syntax for alternate operator between case conditions, such as case[and]; 0.12.6 removes old syntax

0.12.4 changes truthiness checking for numbers, strings, regexes, and ranges

0.12.4 drops the to token ; use .. instead

0.12.4 drops the toBool() and toBoolOrNull() functions

0.12.2 changes the ZLS token to zls

0.12.0 swaps operator precedence for exponents and prefix minus.

0.12.0 drops escape codes \N, \P, and \L.

0.11.4 makes curly braces on catch no longer optional.

0.11.2 changed where() to filter() (deprecated use of where()) and dropped superfluous built-in function bestTag()

0.11.1 changes the name of the default rounding mode to "half away from 0" to match what it actually does.

0.11 changes default rounding to round half away from zero.

0.11 drops likely superfluous functions best(), bestkey(), good(), and wherekeys().

0.10 changes parsing multi-variable assignment in 2 ways (limited to statement context or tests of if expressions, and no longer uses parentheses).

0.10 disallows declarations in given test expressions, but no one will miss it.

0.10 removes break with value not using assignment operator (deprecated in 0.9.6).

0.10 removes using explicitly negated modifiers, as no longer necessary (deprecated in 0.9.4).

0.9.3 allows an ending block quote marker to be spaced from the beginning of the line with tabs and spaces. It also standardizes the result of group() when called with 1 argument (by truthiness) to always put true list first, then false list second.

0.9.2 returns nanoseconds, not seconds, from toNumber() when passed a date-time.

0.9 limits declaration expression context to statement or to if/switch expression tests.

0.8.4 changes the default of base and hex interpolation modifiers to pad with spaces; precede the number with 0 to pad with zeroes. 0.8.4 also fixes padding counts for interpolation modifiers to include the sign, if one present.

0.8 changes the 1 part for loop (test only) to a while loop, with implicit loop variable _while.

0.8 changes the decimal implementation from a fixed 34 digit precision to an "arbitrary precision" decimal. The following changes were also made.

0.7 changes the implicit exception variable from .err to _err.

0.7 removes the use of carriage return/line feed combination for new lines in source code (deprecated since 0.6.8). Use ASCII line feed only ("Linux new line").

0.7 evaluates complex test expressions for given expressions once instead of on every case. This is both more efficient and convenient.

0.6 disallows anything but a variable to be used as a lone token in an interpolation.