github ponylang/ponyc 0.36.0

latest releases: 0.58.5, 0.58.4, 0.58.3...
4 years ago

Pony 0.36.0 is here. We recommend upgrading as soon as possible as it fixes a soundness hole in the type system. Thanks @jasoncarr0!

In addition, 0.36.0 features a few improvements including a small breaking change to the standard library.

Thank you to everyone who contributing to this release, be it by committing code, triaging issues, participating in the RFC process, or otherwise being an awesome member of the Pony community. We see you and we appreciate you. Keep being you and kicking ass.

0.36.0 can be downloaded from Cloudsmith or updated using ponyup. See our installation instructions for more details.

Here are some highlights from this release:

Change trn->trn to box to fix a soundness hole

This change patches a soundness hole in the Pony type system where the viewpoint adaptaion trn->trn is erroneously allowed to be extracted as a trn.

Until we implement George Steed's improved viewpoint adaptation rules, we will be using his non-extracting viewpoint adaptation resulting in box.

This will only break existing Pony code that relies on the viewpoint adaptation trn->trn being equivalent to trn rather than box. In most cases, the trn field of a trn object may be refactored to have the iso capability and fulfill the same requirements.

Force removing read-only files on Windows with FilePath.remove()

FilePath.remove was broken in some cases on Windows. The underlying usage of the C function _unlink() cannot remove a file if it is read-only. This change calls _chmod(..., _S_IWrite) on files that are about to be removed so as to make sure they are removable.

Fix with expressions using tuple destructuring

Prior to this change, a with expression like the following caused the compiler to abort:

with (a, b) = some_tuple do
   error
end

Add LogLevel as argument to LogFormatter

This is a breaking change to the logger package. The log level used by a logger is now available for use when formatting log messages. This will be helpful in replacing the custom log facilities in Corral with the logger in the Pony standard library.

This requires a small change to implementations of the LogFormatter interface:

Before:

primitive MyLogFormatter is LogFormatter
  fun apply(msg: String) => ...

After:

primitive MyLogFormatter is LogFormatter
  fun apply(lvl: LogLevel, msg: String) => ...

RFC 66: Iter maybe

Itertools now provides an API for working with "optional" types (T | None) through an iterator that yields zero or one value. An Iterator[T] can be constructed from a value x: (T | None) using let iter = Iter[T].maybe(x). Then calling iter.next_or(default) will return x, if it is of type T, or default if x is None. For example:

let x: (U64 | None) = 42
match x
| let n: U64 => n.string()
| None => "?"
end

Now can be expressed as:

Iter[U64].maybe(x).map[String]({(n) => n.string() }).next_or("?").string()

[0.36.0] - 2020-07-31

Fixed

  • Compile fix for the latest MSVC compiler (MSVC 19.26.28806.0, from Visual Studio 16.6.2) (PR #3576)
  • Fix with expressions using tuple destructuring. (PR #3586)
  • Fix typeparam check endless recursion (PR #3589)
  • Force removing read-only files on Windows with FilePath.remove() (PR #3588)

Added

  • Added vs2019 preview support for building ponyc (PR #3587)
  • Implement RFC 66: Iter maybe (PR #3603)

Changed

  • Change trn->trn to box to fix a soundness hole (PR #3591)
  • Add LogLevel as argument to LogFormatter (PR #3597)

Don't miss a new ponyc release

NewReleases is sending notifications on new releases.