Skip to content

Releases: actonlang/acton

v0.19.0

08 Jan 23:24
60f23b8
Compare
Choose a tag to compare

Added

  • Much improved argument "rows" support [#1609] [#1617], including:
    • positional & keywords arguments
    • default argument values
  • up, down, left & right in term module now accept n arg [#1619]
    • can move multiple steps in given direction

Changed

  • for http.Client the following positional arguments are now keyword args:
    • schema: defaults to https
    • port: defaults to 80 for schema http and 443 for https
    • tls_verify: default True
    • connect_timeout: default 10.0

Fixes

  • Remove superfluous explicit arguments, now using default values [#1615] [#1618]
  • Now possible to print None [#1609]

Testing / CI

  • Now testing Telemetrify in GitHub Action workflow as part of CI testing
    • Telemetrify is the largest known application written using Acton, so we add
      testing of it to the Acton repo to avoid accidental breakage
    • Telemetrify main branch is already tested with the latest release of Acton
    • now, new changes in acton are also verified against the telemetrify repo
    • we test against the acton-next branch in the telemetrify repo
      • this enables us to make breaking changes in the Acton repo, realize the
        break, then write a fix adapting the telemetrify code to the new Acton
        change and push this to the acton-next branch after which the PR on the
        Acton repo can be retried

v0.18.5

12 Dec 01:16
ac08559
Compare
Choose a tag to compare

Testing / CI

  • Fix build of APT repo

v0.18.4

12 Dec 00:41
002e40e
Compare
Choose a tag to compare

Fixes

  • Add constraint forcing type of self parameter [#1598]
  • Let solver use upper bound of type variable when reducing protocol constraints
  • Remove subclass constraint on isinstance parameters
  • Type error message improvements [#1522] [#1589] [#1596]
  • Fix actonc --debug [#1591]
    • Now also printing zig output
    • --verbose has been removed

Testing / CI

  • Stop testing on MacOS 11 [#1600]
    • Homebrew has dropped support for MacOS 11 so the CI job had to build stuff
      from source making it super slow and fragile, thus dropping it.

v0.18.3

21 Nov 15:40
6ce309e
Compare
Choose a tag to compare

Added

  • type() function that provides the type of something as a string [#1587]
    • Can be really useful as development tool to get inferred types or similar
    • It should not be used for metaprogramming or similar
    • This will likely be removed in the future when there is a better way of
      debugging types, like a language server

Fixed

  • Only print truly unhandled exception [#1586]
    • "Unhandled" Exceptions are no longer printed in actor methods called by
      another actor that awaits the return value
    • It used to be that when an actor B raised an exception in a method called by
      actor A, presuming no try/except handling at all, an Unhandled exception
      message would be printed in both actor A and B.
    • Now we inspect waiting actors and in case there are any, the exception will
      be considered "handled" in the actor method that raised the exception
  • Cleanup old cruft from Makefile [#]
  • Now using zig v0.12.0-dev.1536
    • Improved CPU feature detection for Apple silicon
    • Some smaller zig build system changes, but it seems to be stabilizing as
      there are now docs!
  • Acton now builds on Apple Silicon MacOS [#1582]
    • It used to not understand the CPU features and thus MbedTLS would fail to
      compile
    • With zig v0.12.0, the correct CPU features are recognized
  • Fix int rounding [#1577]
  • Improve DNS error handling in net.TCPConnection [#1573]
    • Ignore DNS resolution errors if we're already in connected state
    • Given happy eyeball support, we could get a A record and establish a working
      IPv4 connection while IPv6 would give an error and be retried continuously,
      which is completely pointless when IPv4 is already established.
  • Type error now separate error from identifier with : [#1583]

Testing / CI

  • Now also testing build / test and running on Ubuntu 23.10
  • There are now golden tests for the compilers type errors [#1571]

v0.18.2

31 Oct 14:03
721c81a
Compare
Choose a tag to compare

A real fix this time to the Debian APT repo.

v0.18.1

31 Oct 12:04
d39e5b5
Compare
Choose a tag to compare

A small fix for Debian builds.

Fixed

  • Align Debian package building on bookworm / 12

v0.18.0

30 Oct 23:35
e26eb3a
Compare
Choose a tag to compare

Added

  • Exceptions now have a __str__() method used to print the exception
    • useful for exception types where we want to be able to include dynamic data
    • string formatting of dynamic log messages is expensive, so we don't want to
      incur that cost for exceptions that are thrown but never printed
    • add extra attributes and print them in __str__() in your custom exceptions
  • Add testing module [#1524] [#1552]
    • Supports four categories of tests:
      • unit tests: proc() -> None, think pure functions
      • synchronous actor tests, involves actors
      • asynchronous actor tests
      • env tests
  • Improvement to type error messages [#1554] [#1556] [#1559]
  • Add term module
    • a couple of small helpers for doing colored text and similar in terminals
  • Add random.choice() & random.choice() [#1541]
  • Add printn() is like print but prints without an ending newline
    • also flushes output immediately, useful to print progress style output
    • this is temporary and will be removed once default argument handling is
      properly implemented
  • Add math.pi = 3.141592653589793 [#1539]
  • acton.rts.enable_gc() & acton.rts.disable_gc()
    • there are situations in which it can be useful to turn off the GC, such as
      during certain test scenarios
  • acton.rts.get_mem_usage() returns memory usage [#]
    • approximate output due to how the GC works
  • Add uri module [#1560]
    • Features a parse_http() function to parse a HTTP URL into its parts

Changed

  • Reverted to global single threaded malloc [#1547]
    • There have been some reports of errors that could potentially be related to
      per-thread malloc or DNS lookups. In caution, the per-thread malloc has been
      disabled and will be brought back in a safe way once we've been able to test
      it much more thoroughly.
  • Integer division by zero now results in exception ZeroDivisionError
    • for float, inf is returned [#1530]
      • this is aligned with IEEE & languages like C, Zig, Rust, Swift, Julia
      • Python raises an exception on float divide by zero
  • Haskell Stack updated to LTS 21.13 using GHC 9.4 [#1517]
    • Some tests show actonc running ~25% faster
      • Presumably thanks to more optimizations in ghc
    • C++ seemingly pulled in as a dependency for building Acton itself :(
      • Would be nice to use zig c++ but alas, that does not work
  • actonc now always built statically on Linux
    • Previously it was only built statically in release mode
    • It does emit some errors / warnings around using dlopen but those are
      harmless and can be ignored in our case
  • commands in argparse now expect proc() rather than pure()
  • JSON encode/decode are now free functions [#1536]
    • the JSON encode and decode functions were implemented as methods on an actor
      due to an earlier actonc bug
    • bug is fixed, so encode() and decode() are now moved to free functions
      in the json module
    • the old Json actor remains and simply wraps the free functions

Fixed

  • Fix error handling in net.TCPConnection for single family use [#1546]
    • original error handling presumed a dual stack socket and so would wait for
      both IPv4 and IPv6 to report an error before propagating the error to the
      caller
    • now if only a single address family is used, errors are immediately sent to
      the caller
  • Fix error handling in net.TCPConnection for dual stack use [#1527]
    • while the original design focused on this use case, there was a bug
  • Honor --root
    • the automatic detection of root actors based on the name main would
      previously override a manually provided one
  • Fix time difference calculation when underflowing
  • Fix add / sub duration & comparison for time.Instant [#1545]
  • Fix premature conversion of input to close converter [#1553]

Testing / CI

  • Now building .debs on Debian 12 / bookworm
  • Avoid DNS lookups in test [#1551]
    • We have a likely bug around DNS lookups that hits on MacOS. Work around by
      using "127.0.0.1" rather than "localhost" in tests.

v0.17.0

26 Sep 20:18
57fcaa0
Compare
Choose a tag to compare

Acton now has exceptions, how exceptional!

Added

  • Add support for exceptions! [#1463]
    • The syntactic support for exceptions has existed for a long time but the
      underlying run time support was not implemented. It now is!
      • It used to be that exceptions would exit the whole application without any
        means of catching an exception.
    • Unhandled exceptions are now printed to stderr [#1481]
      • Do note however that unhandled exceptions will not exit the program nor
        even the actors encountering an exception. It will abort the execution of
        the current method and nothing else.
  • New http module [#1485]
    • http.Client is a HTTP client that supports unencrypted HTTP on port 80 and
      HTTPS using TLS on port 443
    • http.Listener / http.Server is a HTTP server component that currently
      only supports unencrypted HTTP (due to lack of a net.TLSListener)
    • Supports chunked transfer-encoding [#1510]
  • New logging module [#1483]
    • Provides logging functionality in an actor centric world
  • New argparse module [#1499]
    • Command line argument parsing!
  • net.TCPConnection: A new TCP client connection actor [#1398]
    • Support DNS lookups so the input address can be a name rather than an IP
      address
      • It is still possible to connect using an IP address
    • Supports Happy Eyeballs (RFC6555) which uses both IPv4 and IPv6
      simultaneously to connect using the fastest transport
      • Happy Eyeballs is only used for hostnames. If an IP address is provided,
        we connect directly to it.
  • net.TLSConnection: A new TLS client connection actor [#1470]
    • A simple TLS client connection actor. It supports disabling TLS certificate
      verification for testing purposes.
    • Using the MbedTLS library and tlsuv under the hood.
  • net.is_ipv4(address: str) -> bool tells you if something is an IPv4 address
  • net.is_ipv6(address: str) -> bool tells you if something is an IPv6 address
  • AbE: Documented capability based security [#1267]
  • The class name of exception errors is now printed on exception [#1423]
  • actonc build --cpedantic now works, it was previously only supported for
    single files [#1438]
  • It is now possible to have mutually recursive definitions between function
    defs, classes and actors [#1433] [#1435]
  • RTS now uses a per thread malloc implementation [#1456]
    • malloc is part of libgc which has two flavours, a global malloc with a
      lock and a per thread allocator
    • During the restructuring to use Zigs build system, the compilation option to
      use the per thread allocator was lost. It is now back!
    • For parallel workloads across multiple RTS worker threads, there is a clear
      bottleneck around malloc... not very surprisingly ;)
  • RTS readyQ and per actor message queue has been optimized [#1456]
    • There is now a tail pointer which significantly speeds up insertions
    • The fields have been slightly reorganized to allow the most important fields
      early so it can be fetched in one cacheline
    • Before, having many concurrent actors with many outstanding messages would
      scale poorly, on an AMD 5950X running the pairs benchmark:
      • before:
        • 1 actor pair & 1 token: ~4M continuations per second
        • 10 actor pair & 1 token: ~650K continuations per second
        • 1000 actor pair & 1 token: ~280K continuations per second
        • 1000 actor pair & 500 token: ~280K continuations per second
      • after readyQ tail optimization:
        • 1 actor pair & 1 token: ~3.8M continuations per second
        • 1000 actor pair & 1 token: ~3.6M continuations per second
        • 1000 actor pair & 500 token: ~700K continuations per second
      • after msg queue tail optimization:
        • 1 actor pair & 1 token: ~3.8M continuations per second
        • 1000 actor pair & 1 token: ~3.6M continuations per second
        • 1000 actor pair & 500 token: ~3.6M continuations per second
    • This is an artificial benchmark where there is extremely little real work
      done, so continuation switching becomes the dominant load. Thus, the
      bottleneck becomes the global readyQ. Using more than 1 worker thread only
      leads to lock contention and so the benchmarks are for 1 worker thread.
      • Since the actor message queue is per actor, it is possible that multiple
        worker threads could work faster but in practice they step on each others
        toes enough around the global readyQ that it is slower overall.

Changed

  • net.TCPIPConnection is removed and replaced by net.TCPConnection
    • Originally opted to add net.TCPConnection now and phase out
      net.TCPIPConnection later but as there is already a breaking change with
      the change of Auth -> Cap so all user code related to networking (and other
      things) need to be changed, we might as well change from
      net.TCPIPConnection to net.TCPConnection
  • DNS actor is replaced with lookup functions [#1406]
    • The DNS actor is removed, the lookup_a & lookup_aaaa methods it has
      are now free functions in the net module, i.e. simply call net.lookup_a
    • It was originally an actonc shortcoming that lead to the design with a DNS
      actor - it was intentional, so this is more of a cleanup
  • Renamed authentication concept to "capabilities" [#1402] [#1407]
    • In order to better reflect the mental model and intuition we want to instill
      in users of Acton, Auth objects are renamed to Cap
      • With a reference to a capability, we can use that capability. This aligns
        with the existing security model for the internal actor domain where an
        actor must hold a reference to another actor in order to call its method.
      • We want to extend that mental model for all external things in the world
        as well.
    • All *Auth objects now have a Cap suffix
    • All auth args are renamed to cap
  • SysCap is a new capability for functions related to Acton RTS System
    internals [#1388]
    • SysCap is available from env.syscap
    • SysCap is separate from the normal capability hierarchy where WorldCap
      is the root
      • This is to promote the aspiration to restrict access to RTS internal
      • While WorldCap shouldn't be passed around frivolously either,
        capabilities should restricted and delegated, it is still fairly normal to
        pass WorldCap while the vast majority of programs should not even need
        SysCap
  • The msg of exceptions is now optional [#1422]

Fixed

  • Fix control flow bug for continue in for loop [#1265]
  • Fix control flow bug for return in while loop [#1194]
  • Fix comparison of optional types [#1186] [#1506]
  • Fix necessary casts for bool checks on tuple field [#1500] [#1504]
  • Throw exceptions for unimplemented builtins [#1010]
    • Previously printed to stderr and did exit(1)
    • Now throws a NotImplemetedError instead!
  • Failed dict key lookups now throw KeyError [#1499]
    • Previously incorrectly raised IndexError
  • Document use of --sigs in Acton-by-Example [#1405]
  • Fix up-to-date check for stub compilation [#1399]
  • Improve support for alternate output in actonc [#1395]
    • When alternate output is enabled, like actonc --types, now uses quiet
      mode, thus suppressing various progress messages which interferred with the
      alternate output
    • Avoid errors when compiling files without a root actor
  • Clean up old generated output files [#1411]
    • When the source files is moved or removed, also remove the corresponding
      output files
  • Fix return value of int hashable [#1415]
  • Fix module import check [#1420]
  • Avoid segfault when exception error_message is not set [#1422]
  • Bump Zig version to v0.11.0 [#1421]
  • Fix reversed([]) which would SIGILL in dev mode [#1455]
  • Fix reversed([1,2,3]) which now returns reversed result [#1455]
    • Previous code did the reversal but returned the original value :P
  • Fix i64 comparisons like eq/ne/etc [#1459]
    • Would just return the wrong results, like i64(0) == i64(0) would not
      return True. Now works as they should!
  • Fix list add with empty list input, like [1]+[] [#1461]
    • Used to segfault, now works as intended

Testing / CI

  • Stop testing on Ubuntu 22.10 since it is End of Support

v0.16.0

03 Jul 22:28
558e59b
Compare
Choose a tag to compare

Primarily addition of simplified TCP reconnection, related fixes and functionality.

Added

  • Add .close() and .reconnect() on TCP client actor [#1383]
    • It is now possible to explicitly close or reconnect a TCP client
  • Add RTS Monitor actor in acton.rts.Monitor() [#1383]
    • The RTS Monitor actor starts a worker monitor per worker thread, each pinned
      to a particular worker thread. By doing so, it can retrieve information from
      each worker thread in safe manner, honoring the RTS design.
    • Currently just supporting getting handles from I/O subsystem.
  • Add env.nr_threads [#1383]
  • Add set_actor_affinity(wthread_id) [#1383]

Changed

  • Include DNS query hostname in on_error cb [#1382]
    • Simplifies retrying a query since we otherwise do not have a persistent
      tracking object per query

Fixed

  • Fix --rts-debug [#1383]
    • Has been broken since new builder but is now fixed
  • Fix off-by-one in worker thread wake up [#1383]
    • Waking all threads would not consider all threads as there was an off-by-one
      error.
    • No known problems in the field from this, it was only noticed in development
      using --rts-wthreads=1
      • The RTS uses at least 4 workers per default
  • Use relative source file path in logs [#1383] [#1391]
    • __FILE__, set by the C compiler, is used to include source file path in
      log messages
    • Zig uses absolute paths to all files
    • now using -ffile-prefix-map to make path relative
    • project dir name also included, for example base/rts/rts.c, to make it
      easier to understand from which project a file comes from
  • Assignment in multiple branches [#1390] [#1392]
    • Only assigning in multiple branches (not before branches) would lead to
      redefining shadowing variable of outer scope in low level generated C code
    • Info guiding joined assignment has been fixed

Testing / CI

  • Verify we cannot instantiate WorldAuth

v0.15.3

27 Jun 19:09
58c12ae
Compare
Choose a tag to compare

Added

  • actonc --cache CACHEDIR can be used to specify the build cache directory

Fixed

  • static compilation with Musl libc is now possible on Linux [#1372]
    • adjusted to adjtimex
  • hashing for int now supports values outside of i64 [#1348] [#1367]
  • fix __pow__ to avoid compiler optimization bug [#1371]
  • bump Zig version [#1374]
    • avoids "File not Found" error
  • text color in SVG in docs now follow font color [#1365]
  • fix hooking of thread creation to inject signal handler wrapper for stop the
    world [#812]
  • corrected arguments passed to on_error callback of net.DNS related lookup
    functions [#812]
    • .act file specified 2 arguments to the on_error callback while the .ext.c
      file only sent a single argument

Testing / CI

  • cross-compilation is now tested in CI in all jobs for these targets:
    • aarch64-macos-none
    • x86_64-macos-none
    • x86_64-linux-gnu.2.27
    • x86_64-linux-musl
  • CI uses --cache to place build cache in ~/.cache/acton/test-build-cache,
    which is in turn cached in CI
    • the cross-compilation testing meant testing went from ~1 minute to ~3, with
      caching it remains at around ~1 minute