Skip to content

Releases: ponylang/ponyc

0.58.10

01 Feb 12:45
Compare
Choose a tag to compare

Change stack_depth_t to size_t on OpenBSD

The definition of stack_depth_t was changed from int to size_t to support compiling on OpenBSD 7.6.

ponyc may not be compilable on earlier versions of OpenBSD.

Make sure scheduler threads don't ACK the quiescence protocol CNF messages if they have an actor waiting to be run

Prior to this, the pinned actor thread could cause early termination/quiescence of a pony program if there were only pinned actors active. This change fixes the issue to ensure that pony programs with only pinned actors active will no longer terminate too early.

Apply default options for a CLI parent command when a sub command is parsed

In the CLI package's parser, a default option for a parent command was ignored when a subcommand was present. This fix makes sure that parents' defaults are applied before handling the sub command.

Fix compiler crash from match with extra parens around let in tuple

When matching on a tuple element within a union type, the compiler would crash when extra parentheses were present.

The following code fails to compile because of (123, (let x: I32)) in the match. The extra parentheses should be ignored and treated like (123, let x: I32).

let value: (I32 | (I32, I32)) = (123, 42)

match value
| (123, (let x: I32)) => x
end

Fix soundness problem when matching iso variables

We previously switched our underlying type system model. In the process, a
soundness hole was introduced. The following code that should not compile was accepted by the compiler:

class Bad
  let _s: String iso

  new iso create(s: String iso) =>
    _s = consume s

  fun ref take(): String iso^ =>
    match _s
    | let s': String iso => consume s'
    end

The code should not compile because let s': String iso is aliasing _s an iso field. Consuming an aliased iso shouldn't return an iso^.

The take-away is that "very bad things could happen" and the data race freedom guarantees of the Pony compiler were being violated.

We've closed the soundness hole. We recommend all Pony users update to the this release as soon as possible.

[0.58.10] - 2025-02-01

Fixed

  • Make sure scheduler threads don't ACK the quiescence protocol CNF messages if they have an actor waiting to be run (PR #4583)
  • Apply default options for a CLI parent command when a sub command is parsed (PR #4593)
  • Fix compiler crash from match with extra parens around let in tuple (PR #4595)
  • Fix soundness problem when matching iso variables (PR #4588)

Changed

  • Change stack_depth_t to size_t on OpenBSD (PR #4575)

0.58.9

29 Dec 13:59
Compare
Choose a tag to compare

Fixed an issue that caused the actor_pinning documentation to not be built

We fixed an issue that caused the actor_pinning documentation to not be built. This issue has been resolved and the documentation is now available.

[0.58.9] - 2024-12-29

Fixed

  • Fixed an issue that caused the actor_pinning documentation to not be built

0.58.8

27 Dec 18:05
Compare
Choose a tag to compare

Add Fedora 41 as a supported platform

We've added Fedora 41 as a supported platform. We'll be building ponyc releases for it until it stops receiving security updates in November 2025. At that point, we'll stop building releases for it.

Drop Fedora 39 support

Fedora 39 has reached its end of life date. We've dropped it as a supported platform. That means, we no longer create prebuilt binaries for installation via ponyup for Fedora 39.

We will maintain best effort to keep Fedora 39 continuing to work for anyone who wants to use it and builds ponyc from source.

Update Pony musl Docker images to Alpine 3.20

We've updated our ponylang/ponyc:latest-alpine, ponylang/ponyc:release-alpine, and ponylang/ponyc:x.y.z-alpine images to be based on Alpine 3.20. Previously, we were using Alpine 3.18 as the base.

Fix rare termination logic failures that could result in early shutdown

There was a very rare edge case in the termination logic that could result in early shutdown resulting in a segfault.

The edge cases have been addressed and the shutdown/termination logic has been overhauled to make it simpler and more robust.

Add support for pinning actors to a dedicated scheduler thread

Pony programmers can now pin actors to a dedicated scheduler thread. This can be required/used for interfacing with C libraries that rely on thread local storage. A common example of this is graphics/windowing libraries.

The way it works is that an actor can request that it be pinned (which may or may not happen immediately) and then it must wait and check to confirm that the pinning was successfully applied (prior to running any workload that required the actor to be pinned) after which all subsequent behaviors on that actor will run on the same scheduler thread until the actor is destroyed or the actor requests to be unpinned.

Caveat

Due to the fact that Pony uses cooperative scheduling of actors and that all pinned actors run on a single shared scheduler thread, any "greedy" actors that monopolize the cpu (with long running behaviors) will negatively inmpact all other pinned actors by starving them of cpu.

Example program

// Here we have the Main actor that upon construction requests a PinUnpinActorAuth
// token from AmbientAuth and then requests that it be pinned. It then recursively
// calls the `check_pinned` behavior until the runtime reports that it has
// successfully been pinned after which it starts `do_stuff` to do whatever
// work it needs to do that requires it to be pinned. Once it has completed all
// of its work, it calls `done` to request that the runtime `unpin` it.

use "actor_pinning"

actor Main
  let _env: Env
  let _auth: PinUnpinActorAuth

  new create(env: Env) =>
    _env = env
    _auth = PinUnpinActorAuth(env.root)
    ActorPinning.request_pin(_auth)
    check_pinned()

  be check_pinned() =>
    if ActorPinning.is_successfully_pinned(_auth) then
      // do stuff that requires this actor to be pinned
      do_stuff(10)
    else
      check_pinned()
    end

  be do_stuff(i: I32) =>
    if i < 0 then
      done()
    else
      do_stuff(i - 1)
    end

  be done() =>
    ActorPinning.request_unpin(_auth)

[0.58.8] - 2024-12-27

Fixed

  • Fix rare termination logic failures that could result in early shutdown (PR #4556)

Added

  • Add Fedora 41 as a supported platform (PR #4557)
  • Add support for pinning actors to a dedicated scheduler thread (PR #4547)

Changed

  • Drop Fedora 39 support (PR #4558)
  • Update Pony musl Docker images to Alpine 3.20 (PR #4562)

0.58.7

30 Nov 14:02
Compare
Choose a tag to compare

Make actor heap allocations more efficient by recycling freed memory

Prior to this change, the actor heap garbage collection process would return freed memory back to the pony runtime at the end of a garbage collection run. The returning of memory to the pony runtime and allocating of new memory from the pony runtime are both expensive operations. This change makes it so that the actor garbage collection process keeps old freed memory chunks around with the expectation that the actor will very likely need memory again as it continues to run behaviors. This avoids the expensive return to and reallocation of memory from the pony runtime. It is possible that the overall application might end up using more memory as any freed memory chunks can only be reused by the actor that owns them and the runtime and other actors can no longer reuse that memory as they previously might have been able to.

Correctly find custom-built llc during build process

Previously our CMake build was failing to find our custom-built llc binary, but builds worked by accident if there was a system llc. The build system now finds our custom llc correctly.

Fix minor buffer out of bounds access bug in compiler

Previously, the compiler error reporting had a minor buffer out of bounds access bug where it read one byte past the end of a buffer as part of an if condition before checking that the offset was smaller than the buffer length. This was fixed by switching the order of the if condition checks so that the check that the offset is smaller than the buffer length happens before reading the value from the buffer to prefer the out of bounds access issue.

Fix bug in ASIO shutdown

There was a bug during our shutdown process that could cause a segmentation fault coming from our asynchrnous I/O subsystem. This has been fixed.

Fix early quiescence/termination bug

Previously, the logic to detect quiescence had a race condition in relation to dynamic scheduler scaling and it was possible for the runtime to incorrectly detect quiescence and termninate early if a scheduler thread suspended at just the right time.

We have now changed the quiescence logic to keep an accurate track of exactly how many scheduler threads are active at the time the quiescence detection protocol begins so it can ensure that any scheduler threads suspending or unsuspending can no longer cause an incorrect determination that might lead to early termination of the runtime.

[0.58.7] - 2024-11-30

Fixed

  • Correctly find custom-built llc (PR #4537)
  • Fix buffer out of bounds access issue (PR #4540)
  • Fix bug in ASIO shutdown (PR #4548)
  • Fix early quiescence/termination bug (PR #4550)

Changed

  • Recycle actor heap chunks after GC instead of returning to pool (PR #4531)

0.58.6

16 Oct 14:07
Compare
Choose a tag to compare

Fix use after free bug in actor heap finalisation that can lead to a segfault

The 0.45.2 release introduced an improvement to handling of objects with finalisers to make them more efficient to allocate on actor heaps. However, in the process it also introduced a potential for use after free situations that could lead to segfaults when running finalisers. With this change, we've reworked the implementation of the actor heap garbage collection to avoid the potential for use after free situations entirely.

Fix actor heap chunk size tracking bug that could cause a segfault

The 0.55.1 release included some internal actor heap implementation optimizations. Unfortunately, there was a small bug that could potentially cause a segfault due to not properly clearing some bits before setting them for some heap chunks. This change corrects that oversight to ensure the relevant bits are properly cleared before being set to ensure they final result can never be incorrect.

[0.58.6] - 2024-10-16

Fixed

  • Fix use after free bug in actor heap finalisation that can lead to a segfault (PR #4522)
  • Make heap small chunk size setting logic more precise/correct (PR #4527)

0.58.5

01 Jun 18:38
Compare
Choose a tag to compare

Update the base image for our ponyc images

Our Docker images have had their base image updated from Ubuntu 22.04 to Ubuntu 24.04.

[0.58.5] - 2024-06-01

Changed

  • Update the base image for our ponyc images (PR #4515)

0.58.4

01 May 23:11
Compare
Choose a tag to compare

Fix compiler crash

Previously the following code would cause the compiler to crash. Now it will display a helpful error message:

struct FFIBytes
  var ptr: Pointer[U8 val] = Pointer[U8].create()
  var length: USize = 0

  fun iso string(): String val =>
    recover String.from_cpointer(consume FFIBytes.ptr, consume FFIBytes.length) end

actor Main
  new create(env: Env) =>
    env.out.print("nothing to see here")

Add prebuilt ponyc binaries for Ubuntu 24.04

We've added prebuilt ponyc binaries specifically made to work on Ubuntu 24.04.

You can opt into using the Ubuntu binaries when using ponyup by running:

ponyup default ubuntu24.04

Fix generation of invalid LLVM IR

Previously, this code failed at LLVM module verification. Now, with this change, it's fixed by stopping the generation of ret instructions after terminator instructions:

class Foo
  new create(a: U32) ? =>
    error

actor Main
  new create(env: Env) =>
    try
      let f = Foo(1)?
    end

[0.58.4] - 2024-05-01

Fixed

Added

  • Add prebuilt ponyc binaries for Ubuntu 24.04 (PR #4508)

0.58.3

30 Mar 20:42
Compare
Choose a tag to compare

Fix incorrect markdown formatting for types from documentation generation

Previously, we were incorrectly creating field types in markdown documentation. The markdown for the type should have been on a single line but for long union types, it would end up crossing lines. That resulted in broken markdown that wouldn't display correctly.

[0.58.3] - 2024-03-30

Fixed

  • Fix bug in documentation generation (PR #4502)

0.58.2

24 Feb 13:50
Compare
Choose a tag to compare

Fedora 39 added as a supported platform

We've added Fedora 39 as a supported platform. We'll be building ponyc releases for it until it stops receiving security updates at the end of 2024. At that point, we'll stop building releases for it.

Add support for MacOS on Apple Silicon

Back in August of 2023, we had to drop MacOS on Apple Silicon as a supported platform as we had no Apple Silicon test and build environment. We lost our existing environment when we had to migrate off of CirrusCI.

GitHub recently announced that they now have Apple Silicon MacOS machines so, we are back in business and MacOS on Apple Silicon is once again a supported platform.

Fix for potential memory corruption in Array.copy_to

Array.copy_to did not check whether the source or destination Arrays had been initialized or whether the requested number of elements to be copied exceeded the number of available elements (allocated memory). These issues would result in potential dereferencing of a null pointer or attempts to access unallocated memory.

Before this fix, the following code would print 11 then 0:

actor Main
  new create(e: Env) =>
    var src: Array[U8] = [1]
    var dest: Array[U8] = [11; 1; 2; 3; 4; 5; 6]

    try
      e.out.print(dest(0)?.string())
    end
    src.copy_to(dest, 11, 0, 10)

    try
      e.out.print(dest(0)?.string())
    end

After the fix, this code correctly prints 11 and 11.

Fix esoteric bug with serializing bare lambdas

Almost no one uses bare lambdas. And even fewer folks end up passing them through the Pony serialization code. So, of course, Red Davies did just that. And of course, he found a bug.

When we switched to LLVM 15 in 0.54.1, we had to account for a rather large change with how LLVM handles pointer and types. In the process of doing that update, a mistake was made and serializing of bare lambdas was broken.

We've made the fix and introduced a regression test. Enjoy your fix Red!

Add constrained types package to standard library

We've added a new package to the standard library: constrained_types.

The constrained_types package allows you to represent in the type system, domain rules like "Username must be 6 to 12 characters in length and only container lower case ASCII letters".

To learn more about the package, checkout its documentation on the standard library docs site.

You can learn more about the motivation behind the package by reading the RFC.

[0.58.2] - 2024-02-24

Fixed

  • Fix for potential memory corruption in Array.copy_to (PR #4490)
  • Fix bug when serializing bare lambdas (PR #4486)

Added

  • Add Fedora 39 as a supported platform (PR #4485)
  • Add MacOS on Apple Silicon as a supported platform (PR #4487)
  • Add constrained_types package to the standard library (PR #4493)

0.58.1

27 Jan 01:36
Compare
Choose a tag to compare

Fix missing "runtime_info" package documentation

The documentation for the "runtime_info" package wasn't being generated. We've fixed that oversight.

Use the correct LLVM intrinsics for powi on *nix.

We were using outdated LLVM intrinsics llvm.powi.f32j and llvm.powi.f64; updated to use llvm.powi.f32.i32 and llvm.powi.f64.i32.

[0.58.1] - 2024-01-27

Fixed

  • Fix missing "runtime_info" package documentation (PR #4476)
  • Use the correct LLVM intrinsics for powi on *nix. (PR #4481)