Pony 0.22.0 is a recommended update. It's a large update as we ended up not releasing on our normal monthly schedule. There are some stability fixes as well as a variety of other changes. This release includes breaking changes and will probably require you to update your code.

Please note, due to some issues when releasing, we will be doing 0.22.1 release in the next day that will have no changes. It's solely to get an official Docker image built for this release.

Make digestof and hash() return USize instead of U64 and add hash64()

The Hashable interface now requires objects to provide a hash() function returning USize instead of U64 . If some of your types provide hash(), you should change the return type and modify the implementation accordingly. A Hashable64 interface requiring a hash64() function returning U64 is now available.

Forbid impossible pattern matching on generic capabilities

Pattern matching on generic capabilities is now prohibited. This means that code like the following example won't compile anymore.

fun foo [ A : Any #send](a: A ) => match a | let a': Any val => print ( " val " ) else print ( " other " ) end

iftype should be used as a replacement.

fun foo [ A : Any #send](a: A ) => iftype A <: Any val then print ( " val " ) else print ( " other " ) end

New Ponybench API

The ponybench micro-benchmarking framework has changed to have more flexible configuration and produce more detailed statistics. The API now resembles that of the ponytest package and has a greater distinction between synchronous and asynchronous benchmarks. The new framework now provides the option to output CSV with the -csv flag. The CSV output may be used to create box plots, histograms, and other visual representations of the benchmark data. Details of how to use the new API are available in the package documentation.

Expose OutStream rather than StdStream in Env

Previously Env.out and Env.err were of the type StdStream. This worked fine but didn't make for easy testing of output. Env.out and Env.err are now of type OutStream which is an interface rather than a concrete type. By making Env expose and rely on the OutStream interface, it is possible to create mock environments for testing. For example, one can

implement an OutStreamStringAccumulator that accumulates output to a String that can then be checked in a unit test. Updating your code is straightforward. Change StdStream to OutStream for anything where you got the StdStream from Env.

Allow more customization of artificial environments

In the same realm of "Expose OutStream rather than StdStream in Env," we made artificial Env instances even more customizable, which are mostly used for testing. It is now possible to "mock" both Env.input representing stdin and intercept setting the exit code via Env.exitcode.

Env.input used to be of type Stdin which didn't allow easy mocking, now it is the interface InputStream which is easily implemented for testing. Stdin used to require a StdinNotify to receive stdin data to the application. In order to stay consistent with the new InputStream StdinNotify has been renamed to InputNotify .

Rename Date to PosixDate

The Date class has been renamed to PosixDate to better reflect that it is not a full grown date class that handles all corner cases, timezones, calendars. It is implemented after the POSIX tm struct. Its API stayed the same with the exception that now if provided with negative constructor parameters it will coalesce them to 0 to avoid creating invalid dates by accident.

Add SourceLoc.type_name method, showing the name of the containing type

The SourceLoc interface is used for representing a location in Pony source code, filled in automatically by the compiler when using the __loc keyword. A type_name function has been added to this interface, and the method function has been renamed as method_name for consistency. Any Pony code that was using SourceLoc and/or __loc objects to print the name of a method will need to be updated with this name change. They will also now have the type_name available to print if they so choose.

[0.22.0] - 2018-05-24

Fixed

Added

Changed