Skip to content

Releases: ponylang/ponyc

0.18.1

25 Aug 00:14
Compare
Choose a tag to compare

Pony 0.18.1 contains a high priority bug fix in the ProcessMonitor package. We recommend upgrading as soon as possible. There are no breaking changes in this release.

Process monitor async write buffering

Before this release, it was easy to swamp an external process started by the ProcessMonitor with too many writes. Excessive writes would result in errors and lost data. 0.18.1 adds write buffering thereby avoiding lost data.

DragonFly BSD 4.8 support

Pony has been ported to support DragonFly BSD 4.8. Note, we do not have CI for DragonFly, so support is provided on a "best-effort" basis. That is, we won't intentionally break support, but we also aren't actively testing commits against DragonFly so some breakage can be expected.

[0.18.1] - 2017-08-25

Fixed

  • Don't print capabilities for type params when generating docs (PR #2184)

Added

  • DragonFly BSD 4.8 support (PR #2183)
  • Process monitor async write buffering (PR #2186)

0.18.0

19 Aug 14:38
Compare
Choose a tag to compare

Pony 0.18.0 contains a high priority compiler bug fix. We recommend updating as soon as possible. Note, however, that there is a small breaking change in this release as well. It should be a quick upgrade if you are impacted.

Fix compiler crash on union-of-tuples to tuple conversions

Previously, when trying to compile a union-of-tuples, the compiler would segfault. Very annoying if you had a reasonable program like:

primitive Add
primitive Dec
type AddOrDec is (Add | Dec)
type CmRDTCounterOp is (AddOrDec, U128)

class CmRDTCounter
  var _value: U128

  new create() => _value = 0

  fun read(): U128 =>
    _value

  fun ref add(number: U128): CmRDTCounterOp =>
    let op: CmRDTCounterOp =
      if number >= 0 then
        (Add, number)
      else
        (Dec, number)
      end
    apply(op)
    op

  fun ref apply(op: CmRDTCounterOp) =>
    match op
      | (Add, let number: U128) => _value = _value + number
      | (Dec, let number: U128) => _value = _value - number
    end

actor Main
  new create(env: Env) =>
    var counter = CmRDTCounter.create()
    let op1 = counter.add(10)

If you are interested in learning more, we suggest checking out issue #1513 for a bit more background and listen to the August 16, 2017, Pony development sync call where we discussed it in depth.

Change String.join to take Iterable

0.18.0 includes the implementation of RFC #48. It's a nice improvement to the usability of String.join. It is also, sadly, a breaking change. Such is life. Sometimes you break things to improve them. Upgrading should be straightforward.

Where you previously called "_".join(["zomg"]), you would now call "_".join(["zomg"].values()). Any place you hit a compiler error related to String.join, add a .values() to the ReadSeq you are passing and everything will work.

[0.18.0] - 2017-08-19

Fixed

  • Fix compiler crash on union-of-tuples to tuple conversions (PR #2176)
  • Fix compiler error on lambda capture of '_' (PR #2171)
  • Fix read past the end of a buffer in pool.c. (PR #2139)

Changed

  • Make actor continuations a build time option (PR #2179)
  • RFC #48 Change String.join to take Iterable (PR #2159)
  • Change fallback linker to "gcc" from "gcc-6" on Linux. (PR #2166)
  • Change the signature of pony_continuation and pony_triggergc to take a pony_ctx_t* instead of a pony_actor_t*.

0.17.0

05 Aug 20:32
Compare
Choose a tag to compare

Pony 0.17.0 is a recommended release if you are using GCC 7 on Linux. Before this release, GCC 7 was unable to build the Pony compiler. If you aren't using GCC 7, you can take your time upgrading. Please note, there is a breaking change in this release, but it's quite unlikely that anyone will be impacted by it.

Treat as type of array literals as the alias of the element type

Previously, an array literal, even when the as type is given explicitly, uses the alias of the as type as the type argument for the Array type. For example:

trait iso T
class iso A is T
class iso B is T
class iso C is T

actor Main
  new create(env: Env) =>
    let a: T = A
    let b: T = B
    let c: T = C
    let abc: Array[T] = [as T^: A; B; C] // works
    let abc': Array[T] = [as T: A; B; C] // fails: literal has type Array[T!]

We doubt that anyone currently has the `// works`` line anywhere in their code. However, if you are impacted, update it to:

let abc': Array[T] = [as T: A; B; C]

default_pic build option

Previously on platforms that required PIC, you would have to pass the --pic flag to ponyc each time you compiled a Pony program. With the addition of default_pic, you can build ponyc so that --pic is automatically handled for you. Use make default_pic=true when building ponyc and away you go!

[0.17.0] - 2017-08-05

Fixed

  • Fix cursor location for displaying compiler errors and info. (PR #2136)
  • Fix indent detection when lexing docstrings that contain whitespace-only lines. (PR #2131)
  • Fix compiler crash on typecheck error in FFI call. (PR #2124)
  • Fix compiler assert on match including structural equality on union type. (PR #2117)

Added

  • Support GCC7 on Linux (PR #2134)
  • Add regex match iterator (PR #2109)
  • Add more promise methods (RFC 35) (PR #2084)
  • Add ability to default enable PIC when compiling ponyc (PR #2113)

Changed

  • Treat as type of array literals as the alias of the element type. (PR #2126)
  • docgen: ignore test types and add cli flag to only document public types (PR #2112)

0.16.1

30 Jul 01:52
Compare
Choose a tag to compare

Pony 0.16.1 is a quick follow on release to 0.16.0. After releasing 0.16.0, we closed out a couple high priority bugs. Upgrading as soon as possible is recommended. If you haven't upgraded to 0.16.0, check out it's release notes before starting your upgrade.

[0.16.1] - 2017-07-30

Fixed

  • Fix reachability analysis for intersection types (PR #2106)
  • Fix compiler assertion failure at code generation (PR #2099)
  • FreeBSD builds(PR #2107)

0.16.0

28 Jul 18:46
Compare
Choose a tag to compare

Pony 0.16.0 is an awesome step forward but its also going to be a painful step forward. 0.16.0 features the implementation of the "Explicit partial calls" RFC. It is going to break almost every single Pony codebase out there. There are no high priority bug fixes in this release so, you can take your time upgrading.

Explicit partial calls

In Pony 0.16.0, we've introduced a breaking syntax change that affects all
calls to partial functions (functions that can raise an error).

All partial function calls are now required to be followed by a question mark.

For example, iterator.next() is now iterator.next()?, providing a visual
indication at the call site of any places where an error may be raised.

Call sites to partial functions that fail to include the question mark
will result in a compiler error that looks like this:

  /tmp/test.pony:5:19: call is not partial but the method is - a question mark
  is required after this call
      iterator.next()
                    ^
      Info:
      /tmp/ponyc/packages/builtin/array.pony:578:24: method is here
        fun ref next(): B->A ? =>
                             ^

See the RFC for more details: https://github.com/ponylang/rfcs/blob/master/text/0039-explicit-partial-calls.md

As you might imagine, this change will affect nearly every Pony codebase,
so we want to provide support for developers who are making this transition.

We've created migration scripts for the convenience of developers making the
transition. These scripts can ingest Pony compiler errors in the format emitted
by ponyc to STDERR and make the necessary modifications to the Pony source code
files that caused the errors, adding the question mark wherever it is needed
for compliance with the new syntax requirement.

If you need any other assistance with this transition, please reach out to
us. We're here to help!

[0.16.0] - 2017-07-28

Fixed

  • Fix compiler assertion failure on unused reference to _ (PR #2091)
  • Destroy all actors on runtime termination (PR #2058)
  • Fixed compiler segfault on empty triple quote comment. (PR #2053)
  • Fix compiler crash on exhaustive match where last case is a union subset (PR #2049)
  • Make pony_os_std_print() write a newline when given empty input. (PR #2050)
  • Fix boxed tuple identity when type identifiers differ (PR #2009)
  • Fix crash on interface function pointer generation (PR #2025)

Added

  • Alpine Linux compatibility for pony (PR #1844)
  • Add cli package implementing the CLI syntax (RFC #38)
    • Initial (PR #1897) implemented the full RFC and contained:
      • Enhanced Posix / GNU program argument syntax.
      • Commands and sub-commands.
      • Bool, String, I64 and F64 option / arg types.
      • Help command and syntax errors with formatted output.
    • Update (PR #2019) added:
      • String-seq (ReadSeq[String]) types for repeated string options / args.
      • Command fullname() to make it easier to match on unique command names.
      • Checking that commands are leaves so that partial commands return syntax errors.

Changed

  • Forbid returning and passing tuples to FFI functions (PR #2012)
  • Deprecate support of Clang 3.3
  • Explicit partial calls - a question mark is now required to be at the call site for every call to a partial function.
    • See RFC 39.
    • Migration scripts for user code, for convenience, are provided here:

0.15.0

08 Jul 08:27
Compare
Choose a tag to compare

Pony 0.15.0 closes some high priority bugs across all platforms. Upgrading as soon as possible is highly recommended. Please note, this release contains breaking changes and might require code updates on your part.

Exhaustive match

It's one of the most requested features for Pony, and it's finally arrived. Previously the Pony compiler didn't do exhaustiveness checking for matches which meant you always had to have a else None clause. Depending on the situation, this ranged from mildly annoying to exceedingly aggravating. Now instead of having code like:

fun my_fun(a: (String | U64)) =>
  match a
  | let x: String => "something"
  | let y: U64 => "something else"
  else None
    "ugh this sucks"
  end

We have the much more pleasing:

fun my_fun(a: (String | U64)) =>
  match a
  | let x: String => "something"
  | let y: U64 => "something else"
  end

It should be noted that there is currently an open bug related to exhaustive match. If you start taking advantage of exhaustive match, be aware that you might be impacted. Expect a fix in the near future and a new release once that fix lands.

Thanks, Joe McIlvain for bringing this one home.

Custom object serialization

Pony now includes support for custom serialization mechanisms. See RFC #21 for full details. Big thanks to Andrew Turley and the folks at Sendence for this enhancement to Pony serialization.

C API callback support

You can now interoperate with C APIs that requires function callbacks thanks to the newly added "bare lambdas" feature. There are some C libraries that were impossible to work with before this change. We now have a much better C-FFI story to tell. Thanks go out to Benoit for implementing this RFC.

New persistent collections types

Theo Butler added two new persistent collections types (Vector and Set) to the standard library. Thanks Theo for your work pushing the persistent collections classes forward.

Time.wall_to_nanos is no more

If you were previously using Time.wall_to_nanos and you inspected the values you were getting from it; you might have noticed that they weren't particularly "sensible." One would expect the nanosecond value returned to be the number of nanoseconds since "the beginning of time." However, it wasn't. Time.wall_to_nanos has been removed from the standard library and replaced with Nanos.from_wall_clock. If you need to convert a wall clock time into a nanosecond timestamp since "the beginning of time," this is your function. Code that was previously:

use time

fun my_time_thing() =>
  Time.wall_to_nanos(Time.now())

should be updated to be:

use time

fun my_time_thing() =>
 Nanos.from_wall_clock(Time.now())

Machine word constructors no longer have a default argument

Honestly, this breaking change shouldn't be a breaking change for anyone. If it is, you are doing something pretty special. This change fixes some issues with comparing machine words using the is keyword. Full details can be seen in the PR.

iftype syntax update

We recently introduced a new iftype syntax. After it was released, we decided that the keywords introduced for it were less than optimal. With this change, the elseiftype keyword is removed and replaced with elseif. This is a breaking change but, given the newness of iftype, we doubt it impacts on anyone yet.

[0.15.0] - 2017-07-08

Fixed

  • Fix bug in as capture (PR #1981)
  • Fix assert failure on lambda parameter missing type. (PR #2011)
  • Fix iftype where the type variable appears as a type parameter. (PR #2007)
  • Fix support for recursive constraints in iftype conditions. (PR #1961)
  • Fix segfault in Array.trim_in_place (PR #1999)
  • Fix segfault in String.trim_in_place (PR #1997)
  • Assertion failure with directly recursive trait (PR #1989)
  • Add compile error for generic Main (PR #1970)
  • Prevent duplicate long_tests from being registered (PR #1962)
  • Assertion failure on identity comparison of tuples with different cardinalities (PR #1946)
  • Stop default arguments from using the function scope (PR #1948)
  • Fix compiler crash when a field is used in a default argument. (PR #1940)
  • Fix compiler crash on non-existent field reference in constructor. (PR #1941)
  • Fix compiler crash on "_" as argument in a case expression. (PR #1924)
  • Fix compiler crash on type argument error inside an early return. (PR #1923)
  • Correctly generate debug information in forwarding methods (PR #1914)
  • Resolved compiler segfault on optimization pass (issue #1225) (PR #1910)
  • Fix a bug in finaliser handling (PR #1908)
  • Fix compiler crash for type errors in call arguments inside a tuple. (PR #1906)
  • Fix compiler crash involving "dont care" symbol in an if or try block. (PR #1907)
  • Don't call TCPConnection backpressure notifies incorrectly (PR #1904)
  • Fix outdated methods in persistent.Map docstring. (PR #1901)
  • Fix format for number types (issue #1920) (PR #1927)

Added

  • Make tuples be subtypes of empty interfaces (like Any). (PR #1937)
  • Add Persistent Vec (RFC 42) (PR #1949)
  • Add support for custom serialisation (RFC 21) (PR #1839)
  • Add persistent set (RFC 42) (PR #1925)
  • Bare methods and bare lambdas (RFC 34) (PR #1858)
  • xoroshiro128+ implementation (PR #1909)
  • Exhaustive match (RFC #40) (PR #1891)
  • Command line options for printing help (PR #1899)
  • Nanos.from_wall_clock function to convert from a wall clock as obtained from Time.now() into number of nanoseconds since "the beginning of time". (PR #1967)

Changed

  • Change machine word constructors to have no default argument. (PR #1938)
  • Change iftype to use elseif instead of elseiftype as next keyword. (PR #1905)
  • Removed misleading Time.wall_to_nanos. (PR #1967)

0.14.0

06 May 10:08
Compare
Choose a tag to compare

0.14.0 closes many high priority bugs across all platforms. You should upgrade as soon as possible. This is a breaking release. You will need to update your code.

PR #1886 which fixes 3 "garbage collection" bugs. They were not, however, garbage collection bugs. This problem was a single error in the hashmap implementation that underlies much of the Pony runtime. Interested in learning more about the Pony runtime? The commit comment for the PR makes for interesting reading.

This release also includes RFC #23.
RFC #23 changes the Pony standard library to force the implementation of network error handling code. From the RFC motivation:

Prevent Pony users from creating "silent failure" scenarios with their network code. TCPConnectionNotify, UDPNotify, and TCPListenNotify will all, by default, silently eat connection failures.

When you are upgrading, if you have any code that uses TCPConnectionNotify, UDPNotify, or TCPListenNotify and you didn't implement:

  • TCPConnectionNotify.connect_failed
  • UDPNotify.not_listening
  • TCPListenNotify.not_listening

You will be required by the compiler to implement them. Adding something like:

fun ref connect_failed(conn: TCPConnection ref) =>
  """
  Intentionally ignoring the connection failing!
  WHEEEEEEEEEE! YOLO! Data loss is going to occur. ¯\_(ツ)_/¯
  """
  None

will get you the previous "silently eat errors" behavior. But, at least this time, you'll be doing it intentionally.

[0.14.0] - 2017-05-06

Fixed

  • Compiler error instead of crash for invalid this-dot reference in a trait. (PR #1879)
  • Compiler error instead of crash for too few args to constructor in case pattern. (PR #1880)
  • Pony runtime hashmap bug that resulted in issues #1483, #1781, and #1872. (PR #1886)
  • Compiler crash when compiling to a library (Issue #1881)(PR #1890)

Changed

  • TCPConnection.connect_failed, UDPNotify.not_listening, TCPListenNotify.not_listening no longer have default implementation. The programmer is now required to implement error handling or consciously choose to ignore. (PR #1853)

0.13.2

29 Apr 11:56
Compare
Choose a tag to compare

0.13.2 is a bug fix release that mostly touches on some corner cases in the type system. Upgrade at your leisure.

[0.13.2] - 2017-04-29

Fixed

  • Don’t consider type arguments inside a constraint as constraints. (PR #1870)
  • Disable mcx16 on aarch64 (PR #1856)
  • Fix assert failure on explicit reference to this in constructor. (issue #1865) (PR #1867)
  • Compiler crash when using unconstrained type parameters in an iftype condition (issue #1689)

0.13.1

22 Apr 12:05
Compare
Choose a tag to compare

0.13.1 is a high priority release that everyone is encouraged to update as soon as possible. PR #1842 fixed a garbage collection bug that resulted in GC running too often and in turn could have a large impact on performance for some applications.

[0.13.1] - 2017-04-22

Fixed

  • Reify function references used as addressof operands correctly (PR #1857)
  • Properly account for foreign objects in GC (PR #1842)
  • Compiler crash when using the addressof operator on a function with an incorrect number of type arguments

Added

0.13.0

07 Apr 23:00
Compare
Choose a tag to compare

0.13.0 is a high priority release recommended for all Pony users. #1868 fixes a type system problem identified by Paul Liétar. Paul is currently working on verifying the Pony type system as part of his final year project at Imperial College. Expect to see more high priority releases as we fix problems that Paul identifies.

There is also a breaking change in 0.13.0. RFC #41 was implemented and merged to master. The received method on TCPConnectionNotify now takes an additional parameter. For any of your code, if you previously had:

fun ref received(conn: TCPConnection ref, data: Array[U8] iso): Bool

You'll need to update your method signature to be:

fun ref received(conn: TCPConnection ref, data: Array[U8] iso, times: USize): Bool

It's safe to ignore the times parameter unless you need more fine-grained control over how a TCPConnection interacts with the Pony scheduler.

[0.12.3] - 2017-04-07

Fixed

  • Do not allow capability subtyping when checking constraint subtyping. (PR #1816)
  • Allow persistent map to use any hash function (PR #1799)

Changed

  • Pass # of times called to TCPConnectionNotify.received (PR #1777)