Skip to content

Releases: ponylang/ponyc

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)

0.58.0

24 Nov 13:56
Compare
Choose a tag to compare

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.

[0.58.0] - 2023-11-24

Changed

  • Disallow return at the end of a with block (PR #4467)
  • Make the verify pass on by default (PR #4036)

0.57.1

29 Oct 02:18
Compare
Choose a tag to compare

Fix compiling Pony programs on x86 MacOS when XCode 15 is the linker

With the introduction of XCode 15, you could no longer link Pony programs on x86 MacOS. We've fixed the issue. Apple Silicon was uneffected.

[0.57.1] - 2023-10-29

Fixed

  • Fix compiling Pony programs on X86 MacOS when XCode 15 is the linker (PR #4466)

0.57.0

08 Oct 14:54
Compare
Choose a tag to compare

Fix broken DTrace support

Quite a while back, we broke the support in our Makefile for building the Pony runtime with support for DTrace. We've fixed that and added tests to assure it builds.

Fix compilation error when building with pool_memalign in release mode

When attempting to build the Pony runtime with the pool_memalign option, users would encounter a compilation error if building a release rather than debug version of the runtime. We've fixed the compilation error and added CI testing to verify we don't get a regression.

Fix compiler bug that allows an unsafe data access pattern

In November of last year, core team member Gordon Tisher identified a bug in the type system implementation that allowed sharing of data that shouldn't be shareable.

The following code should not compile:

class Foo
  let s: String box

  new create(s': String box) =>
    s = s'

  fun get_s(): String val =>
    // this is unsafe and shouldn't be allowed
    recover val s end

actor Main
  new create(env: Env) =>
    let s = String
    s.append("world")
    let foo = Foo(s)
    env.out.print("hello " + foo.get_s())

Upon investigation, we found that this bug goes back about 8 or 9 years to the when viewpoint adaptation was introduced into the Pony compiler.

We've fixed the logic flaw and added tests to verify that it can't be reintroduced.

This will potentially break your code if you coded an unsafe recover block that the compiler previously allowed.

[0.57.0] - 2023-10-08

Fixed

  • Fix broken DTrace support (PR #4453)
  • Fix compilation error when building with pool_memalign in release mode (PR #4455)
  • Fix compiler bug that allows an unsafe data access pattern (PR #4458)

Changed

  • Fix compiler bug that allows an unsafe data access pattern (PR #4458)

0.56.2

16 Sep 12:52
Compare
Choose a tag to compare

"No op" release to get Windows release out

When we moved from CirrusCI to GitHub Actions, we had some issues with the Windows releases that were do to tiny typos in the config that linting didn't catch.

This resulted in there being no 0.56.0 and 0.56.1 Windows releases. Because 0.56.1 was primarily to fix a Windows bug, we are doing a 0.56.2 release that should hopefully work for Windows as we think we have found all the tiny typos.

[0.56.2] - 2023-09-16

Added

  • "No op" release to get Windows release out

0.56.1

16 Sep 12:22
Compare
Choose a tag to compare

Fix "double socket close" issue with Windows version of TCPConnection

When fixing a number of "smaller" Windows TCP networking issues a couple years back, in addition to fixing those issues, we introduced a new bug. That bug lingered for two years. It lingered in large part because it would only become apparent in a low resource environment.

When we recently switched our Windows CI from CirrusCI to GitHub Actions, we went from a high-resource environment to a low-resource environment and started getting a ton of "random" Windows TCP test failures.

The problem that was fairly easy to recreate in a test environment would be fairly unlikely in most applications but existed nontheless. The scenario in our test environment was like this:

  • Test 1 runs and completes but hasn't done test teardown yet
  • Test 2 starts up
  • Test 1 runs the "buggy" line of code and closes the socket it has been using with OS, but doesn't reset its own internal record of the file descriptor for the socket.
  • Test 2 is gets a socket from the OS with the file descriptor for the socket just closed by Test 1
  • Test 1 still has a "valid" file descriptor and as part of full shutdown, closes the socket associated with "its" file descriptor. When Test 1 does this, test 2's socket closes and the test fails to complete successfully.

The problem would appear "in the wild" if a Windows application was quickly closing and opening TCP sockets in a manner similiar to the Pony standard library TCP tests.

[0.56.1] - 2023-09-16

Fixed

  • Fix "double socket close" issue with Windows version of TCPConnection (PR #4437)