Skip to content

0.24.0

Compare
Choose a tag to compare
@SeanTAllen SeanTAllen released this 29 Jun 19:06

Pony 0.24.0 includes high-priority bug fixes. Updating as soon as possible is recommended. The release also contains breaking changes, please refer to the release notes for more details.

Remove HTTP libraries from the Pony standard library

The net/http package has been removed from the stdlib, with it the HTTPClient, HTTPServer and URL classes. They now live in the http package and can be included using stable by adding them to your bundle.json like so:

stable add github ponylang/http --tag 0.1.0

The code in the new repository at version 0.1.0 is exactly the same as it was when it was removed from stdlib. Thus the only change you need to do is to change your imports from use "net/http" to use "http".

Change refcap of JsonDoc for better usability

The json package got rid of some inconveniences you could encounter when using JsonDoc to parse JSON and access the parsed representation. This was due to the constructor of JsonDoc returning instances with an iso reference capability and having the actual JSON data inside being ref (in some cases). For ensuring safety the compiler does not allow to access ref fields from an iso reference (they are being seen as tag). This could have led to confusing error messages.

This is all gone now, JsonDoc will be created with a ref reference capability. That means it is not sendable by default anymore, but now much much more usable:

use "json"
actor Main
  new create(env: Env) =>
    try
      let doc = JsonDoc
      doc.parse("""{"array": [1, "str", true]}""")
      let obj = doc.data as JsonObject
    end

Change NetAddress class to hide its fields behind functions, fixing cross-platform compatibility

net.NetAddress has been modelled after the C union sockaddr_storage which happens to have different fields on different platforms (i.e. on linux a 16 bit family field and on e.g. OSX an 8 bit length field an only a 8 bit family field). This PR unifies net.NetAddress to return consistent values on any platform Pony is supported on. To this end, all previously public fields on this class have been made private and new functions have been introduced to return those values:

  • Removed Field | New Method
  • length: U8 | length(): U8
  • family: U8 | family(): U8
  • port: U16 | port(): U16
  • addr: U32 | ipv4_addr(): U32
  • addr1, addr2, addr3, addr4 | ipv6_addr(): (U32, U32, U32, U32)
  • scope: U32 | scope(): U32

All functions return the values in host byte order, that means conversion using @ntohX FFI functions is not necessary anymore. Before calling and using ipv4_addr() or ipv6_addr() check ip4(): Bool and ip6(): Bool which one to use, otherwise the returned values will be invalid (as before using the fields).

[0.24.0] - 2018-06-29

Fixed

  • Always use "binary" mode when opening files on Windows. (PR #2811)
  • Do not set File._errno when reading less than requested bytes. (PR #2785)
  • Correctly allocate memory for linker arguments (PR #2797)
  • Fix build on DragonFly BSD (PR #2794)
  • Fix some edge cases in code generation for loops that jump away. (PR #2791)
  • Fix repeat loop symbol tracking to allow more valid cases. (PR #2786)
  • Fix incorrect disposable/destroyed epoll resubscribe handling (PR #2781)
  • Fix GC-safety issue with writev pointers in File. (PR #2775)
  • Disable neon for armhf if not supported by C/C++ compiler (PR #2672)

Changed

  • Run cycle detector every N ms based on timer (PR #2709)
  • [RFC 55] Remove package net/http from stdlib (PR #2795)
  • Change refcap of JsonDoc to ref for better usability (PR #2747)
  • Change NetAddress class to hide its fields behind functions, fixing cross-platform compatibility. (PR #2734)