langur

download

Compiling langur 0.8 also requires the following (see installation instructions).

With 0.8, it is no longer necessary to use the decNumber library and CGo wrapper, as it has been replaced with a slightly modified version of shopspring/decimal, a native Go library with arbitrary precision.

Compiling langur 0.7 or earlier also requires the following (see installation instructions).

revision history

A full revision history is included in the download.

2020-02-23 - 0.8.6 - added built-in gcd() and lcm() functions - renamed OpIntDivide as OpTruncateDivide 2020-02-13 - 0.8.5 - added floor division operator // - allow an ASCII space on each side of an interpolation modifier for readability - allow an if statement to carry an expression, not just a flow-breaking statement - edited token rules to allow immediate opening parenthesis after tokens not, throw, return, break - checks for invalid use of parentheses on else if of catch block (resembling shortened form if expression) 2020-02-12 - 0.8.4 - changed default of base and hex interpolation modifiers to pad with spaces; precede number with 0 to pad with zeroes - updated fixed point interpolation modifier to allow padding with zeroes - fixed padding counts for interpolation modifiers to include the sign, if one present 2020-02-10 - 0.8.3 - added array multiplication - added built-in X() and mapX() functions - added built-in minmax() function, returning a range - made ranges indexable for reading or setting; can still use first() or last() functions to read them; len() returns 2 when given a range - updated map() to allow no-op functions with multiple arrays (passes through as array of values from each) - added fixed point interpolation modifier - updated hex and base interpolation modifiers to round fractionals instead throwing an exception - split ParameterCount field of CompiledCode objects into ParamMin and ParamMax 2020-02-09 - 0.8.2 - renamed nodiv operator as ndiv 2020-02-09 - 0.8.1 - added scientific notation interpolation modifier - updated hex and base interpolation modifiers to allow requirement of sign (use + on positive numbers) - added divisible by operator div and not divisible by operator nodiv (and the null-propagating operators div? and nodiv?) - allow for or while to start an unbounded argument list - removed noop keyword token, as it is not needed 2020-02-05 - 0.8.0 - changed decimal floating point implementation to arbitrary precision, using a slightly modified version of github.com/shopspring/decimal - as the new decimal library has no NaN or Infinity values, removed them from langur - removed built-in functions isInfinity(), isNaN(), isSpecial(), ns(), isNumType(), toNumType() - replaced isPosNumType() with isPos() - added VM mode setting ability (from source code); initially only settable at the program scope - added VM mode settings divMaxScale (default 33), consoleText (default true), and newFilePerm (default 8x664) - uses the while keyword for a 1 part (test only) loop instead of the for keyword, and default _while loop value variable - generally catch panics in parser or compiler and convert to errors - merged token types/descriptions into one set of constants

breaking changes

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.

license

Langur uses the Apache license 2.0.

The Go wrapper for decNumber and the decNumber library use an ICU license, which is included with the download.