Releases: ponylang/ponyc
0.58.9
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
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
0.58.7
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
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
0.58.5
0.58.4
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
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
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
0.58.1
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.f32
j and llvm.powi.f64
; updated to use llvm.powi.f32.i32
and llvm.powi.f64.i32
.
[0.58.1] - 2024-01-27
Fixed
0.58.0
Disallow return
at the end of a with
block
When we reimplemented with
blocks in 2022, we allowed the usage of return
at the end of the block. Recent analysis of the generated LLVM flagged incorrect LLVM IR that was generated from such code.
Upon review, we realized that return
at the end of a with
block should be disallowed in the same way that return
at the end of a method is disallowed.
This a breaking change. If you had code such as:
actor Main
new create(env: Env) =>
with d = Disposble do
d.set_exit(10)
return
end
You'll need to update it to:
actor Main
new create(env: Env) =>
with d = Disposble do
d.set_exit(10)
end
The above examples are semantically the same. This also fixes a compiler crash if you had something along the lines of:
actor Main
new create(env: Env) =>
with d = Disposble do
d.set_exit(10)
return
end
let x = "foo"
Where you had code "after the return" which would be unexpected by the compiler.
Turn on verify
pass by default
The verify
compiler pass will check the LLVM IR generated for the program being compiled for errors. Previously, you had to turn verify on. It is now on by default and can be turned off using the new --noverify
option.
We decided to turn on the pass for two reasons. The first is that it adds very little overhead to normal compilation times. The second is it will help generate error reports from Pony users for lurking bugs in our code generation.
The errors reported don't generally result in incorrect programs, but could under the right circumstance. We feel that turning on the reports will allow us to find and fix bugs quicker and help move us closer to Pony version 1.