Releases: actonlang/acton
Releases · actonlang/acton
v0.19.0
Added
- Much improved argument "rows" support [#1609] [#1617], including:
- positional & keywords arguments
- default argument values
up
,down
,left
&right
interm
module now acceptn
arg [#1619]- can move multiple steps in given direction
Changed
- for
http.Client
the following positional arguments are now keyword args:schema
: defaults tohttps
port
: defaults to80
for schemahttp
and443
forhttps
tls_verify
: defaultTrue
connect_timeout
: default10.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 theacton-next
branch after which the PR on the
Acton repo can be retried
- this enables us to make breaking changes in the Acton repo, realize the
- Telemetrify is the largest known application written using Acton, so we add
v0.18.5
Testing / CI
- Fix build of APT repo
v0.18.4
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.
- Homebrew has dropped support for MacOS 11 so the CI job had to build stuff
v0.18.3
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, anUnhandled 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
- "Unhandled" Exceptions are no longer printed in actor methods called by
- 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
- It used to not understand the CPU features and thus MbedTLS would fail to
- 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
A real fix this time to the Debian APT repo.
v0.18.1
A small fix for Debian builds.
Fixed
- Align Debian package building on bookworm / 12
v0.18.0
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
- unit tests:
- Supports four categories of 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
- there are situations in which it can be useful to turn off the GC, such as
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
- Features a
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.
- There have been some reports of errors that could potentially be related to
- 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
- for
- 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
- Some tests show actonc running ~25% faster
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 expectproc()
rather thanpure()
- 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()
anddecode()
are now moved to free functions
in thejson
module - the old
Json
actor remains and simply wraps the free functions
- the JSON encode and decode functions were implemented as methods on an actor
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
- original error handling presumed a dual stack socket and so would wait for
- 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
- the automatic detection of root actors based on the name
- 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.
- We have a likely bug around DNS lookups that hits on MacOS. Work around by
v0.17.0
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.
- It used to be that exceptions would exit the whole application without any
- 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.
- Do note however that unhandled exceptions will not exit the program nor
- The syntactic support for exceptions has existed for a long time but the
- New
http
module [#1485]http.Client
is a HTTP client that supports unencrypted HTTP on port 80 and
HTTPS using TLS on port 443http.Listener
/http.Server
is a HTTP server component that currently
only supports unencrypted HTTP (due to lack of anet.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.
- Happy Eyeballs is only used for hostnames. If an IP address is provided,
- Support DNS lookups so the input address can be a name rather than an IP
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.
- A simple TLS client connection actor. It supports disabling TLS certificate
net.is_ipv4(address: str) -> bool
tells you if something is an IPv4 addressnet.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
- before:
- 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.
- Since the actor message queue is per actor, it is possible that multiple
Changed
net.TCPIPConnection
is removed and replaced bynet.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
tonet.TCPConnection
- Originally opted to add
DNS
actor is replaced with lookup functions [#1406]- The
DNS
actor is removed, thelookup_a
&lookup_aaaa
methods it has
are now free functions in thenet
module, i.e. simply callnet.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
- The
- 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.
- With a reference to a capability, we can use that capability. This aligns
- All
*Auth
objects now have aCap
suffix - All
auth
args are renamed tocap
- In order to better reflect the mental model and intuition we want to instill
SysCap
is a new capability for functions related to Acton RTS System
internals [#1388]SysCap
is available fromenv.syscap
SysCap
is separate from the normal capability hierarchy whereWorldCap
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
passWorldCap
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
infor
loop [#1265] - Fix control flow bug for
return
inwhile 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!
- Previously printed to stderr and did
- Failed dict key lookups now throw
KeyError
[#1499]- Previously incorrectly raised
IndexError
- Previously incorrectly raised
- 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
- When alternate output is enabled, like
- Clean up old generated output files [#1411]
- When the source files is moved or removed, also remove the corresponding
output files
- When the source files is moved or removed, also remove the corresponding
- 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 wouldSIGILL
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
returnTrue
. Now works as they should!
- Would just return the wrong results, like
- 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
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.
- The RTS Monitor actor starts a worker monitor per worker thread, each pinned
- 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
- Simplifies retrying a query since we otherwise do not have a persistent
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
- Waking all threads would not consider all threads as there was an off-by-one
- 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
- Only assigning in multiple branches (not before branches) would lead to
Testing / CI
- Verify we cannot instantiate WorldAuth
v0.15.3
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 ofi64
[#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 ofnet.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
- .act file specified 2 arguments to the
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
- the cross-compilation testing meant testing went from ~1 minute to ~3, with