0.25.0 Released

Saturday, October 13, 2018 | Posted in Release

Pony 0.25.0 includes high-priority bug fixes. Updating as soon as possible is recommended. The release also contains breaking changes, please refer to the release notes for more details.

Hello!

Welcome the release notes for Pony 0.25.0. A big thank you to all the volunteers who made this release possible. The big highlight of this release is the addition of “partial math” operators for Pony. Previously, all math operators were total. This means, that they would never error. Would always return a “valid” result. This was fairly non-controversial except for one case: divide by zero. O lordy, that generated lots of buzz and comments from the peanut gallery. Read on to learn more about everything that was implemented as part of the “partial arithmetic” RFC.

[RFC 58] Add partial arithmetic for integer types

With this RFC Pony finally adds the means to do partial arithmetic on integers. It introduces a new set of operators: +?, -?, *?, /? and %? that all raise an error when they detect overflow/underflow or division by zero. The non-partial versions all wrapped around on overflow/underflow or defined division by zero to be 0, if this is not acceptable for you, you now can make use these operators. And if erroring is not your way, you can go with addc, subc, mulc, divc or remc which return the result together with a flag denoting overflow/underflow or division by zero. Check out the full story on the tutorial: https://tutorial.ponylang.io/expressions/arithmetic.html

For the curious, the full RFC is available for your reading pleasure.

OpenBSD support

Nice! I mean the title says it all right? Thanks to Brian Callahan for this. There’s packaging too, you should be able to pkg_add ponyc.

This change renames the % operation from mod, standing for Modulo, to rem, standing for Remainder. The reason is that % in Pony was actually computing the remainder, not the modulo. The difference is obvious when handling signed integers:

The result of the Modulo operation always has the sign of the divisor, e.g.: -5 mod 2 = 1.

The result of the Remainder operation always has the sign of the dividend, e.g.: -5 rem 2 = -1.

Pony does the latter. We are working on adding a proper Modulo operator later on.

This is a breaking change, if you used one the mod function on Integers or implemented your own mod operator on your data types.

Improved CHAMP map

The persistent HashMap and HashSet have reduced memory consumption and improved iteration performance. This change also includes a bug fix related to searching for nonexistent entries and incorrect CHAMP compression.

buffered performance improvements and bug fix

Pony now has efficient reading and writing of numeric datatypes from Array[U8]s and the buffered Reader and Writer classes. Also included is a bug fix related to searching for bytes within a Reader where searches that would fail incorrectly will now succeed.

Fix hash collision handling in persistent map

The persistent HashMap and HashSet have reduced memory consumption and improved iteration performance. This change also includes a bug fix related to searching for nonexistent entries and incorrect CHAMP compression.

Add ability to get iso array from an iso string.

It is now possible to consume a string iso to get the underlying Array[U8] iso for when it is important to convert a string to an array but retain the ability to modify it afterwards.

Use RLIMIT_STACK’s current limit for Pthreads stack size if it is sane

The Pony runtime on OS X/macOS now uses the POSIX standard’s RLIMIT_STACK limit to set the Pthread stack size for the Pony runtime’s scheduler threads.

Fixed

  • Fix invalid allocation bug in runtime that allows for segfaults (PR #2896)
  • buffered performance improvements and bug fix (PR #2890)
  • Fix hash collision handling in persistent map (PR #2894)
  • Correctly handle modifier keys for TTY stdin on Windows (PR #2892)
  • Fix installation of libponyrt.bc on Linux (PR #2893)
  • Fix compilation warning on windows. (PR #2877)
  • Fix building on Windows in a directory with spaces in its name (PR #2879)
  • Fix losing data when reading from STDIN. (PR #2872)
  • Fix validation of provides lists of object literals. (PR #2860)
  • Fix files/Path.clean() not correctly handling multiple .. (PR #2862)
  • Fix skipped try-then clauses on return, break and continue statements (PR #2853)
  • Fix performance and memory consumption issues with files.FileLines (PR #2707)
  • Fix ASIO one shot lost notifications problem (PR #2897)

Added

  • Add ability to get iso array from an iso string. (PR #2889)
  • Add modc method to integer types (PR #2883)
  • Add divc method to integer types (PR #2882)
  • [RFC 58] Add partial arithmetic for integer types (PR #2865)
  • Added OpenBSD support. (PR #2823)
  • Added set_up method to ponytest.UnitTest as equivalent to existing tear_down method (PR #2707)
  • Added keep_line_breaks argument to function buffered.Reader.line (PR #2707)

Changed

  • Rename mod and related operators to rem (PR #2888)
  • Improved CHAMP map (PR #2894)
  • Use RLIMIT_STACK’s current limit for Pthreads stack size if it is sane (PR #2852)
  • Remove File.line method in favor of using FileLines (PR #2707)

AUTHOR

Sean T. Allen

Sean is a member of the Pony core team. His turn-ons include programming languages, distributed computing, Hiwatt amplifiers, and Fender Telecasters. His turn-offs include mayonnaise, stirring yogurt, and sloppy code. He is one of the authors of Storm Applied, and VP of Engineering at Wallaroo Labs.