Skip to content

0.2.1

Compare
Choose a tag to compare
@darrylabbate darrylabbate released this 17 Jul 22:02
· 218 commits to master since this release
0.2.1
0e610e4

Riff 0.2.1 introduces a new method for generating pseudo-random numbers, as well as other various enhancements.

New Features

  • Extra forms of calling rand() to produce pseudo-random numbers:
    • rand(x,y)
    • rand(<range>) (e.g. rand(x..y:z))
  • Command-line options:
    • -h for printing basic usage information.
    • -- for preventing any more command-line options from being processed.
  • %b format specifier for formatting values as unsigned binary integers in fmt().

Changes

  • Pseudo-random numbers are now generated using xoshiro256** instead of the POSIX rand48() family of functions.
  • Floats resulting from addition, subtraction or multiplication operations are no longer promoted to integers. Previously, the VM coerced results of these operations to integers if the float was equivalent to its truncated version (i.e. result == (int64_t) result).
  • null is returned when subscripting a value whose type isn't supported by subscripting operations (previously 0).
  • Version information is now generated from git describe at compile-time, instead of being hardcoded as a preprocessor macro.

Fixes

  • An operator precedence issue caused by consuming unary minus symbols (-) directly prefixed to numeric literals during lexical analysis.
  • Any Riff value will properly seed the PRNG via srand(). Previously, values would be coerced to integers before seeding the PRNG.
  • String table keys that evaluate to 0 are now checked for the literal 0. This fixes a rare issue where strings like "+" would be interpreted as 0.
  • Intermediate rf_str objects are no longer allocated and freed for string concatenation.

Full Changelog: 0.2...0.2.1