Skip to content

v0.22.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 14 Apr 11:31
· 108 commits to main since this release
f73b9f9

Support for Windows and continued improvements for acton test! Internally the
biggest change is the removal of link time redirection of malloc, which opens up
for more flexible memory management.

Added

  • Acton programs now run on Windows!
    • It is now possible to compile Acton programs for Windows, both x86_64 and
      aarch64, although since Acton itself (compiler etc) is not available on
      Windows, only cross-compilation from MacOS or Linux is possible.
    • Use acton --target aarch64-windows-gnu examples/helloworld.act to produce
      examples/helloworld.exe which can be run on Windows
    • Acton applications compiled for Windows are single threaded
    • termios related terminal settings, is not supported on Windows
  • Acton RTS now supports actor cleanup through GC finalization
    • Define a action def __cleanup__(): action on your actor and it will be run
      when the actor is about to be garbage collected
  • acton build now builds dependencies in deps/ before building the main
    project
  • acton test now excludes the time spent in GC from test times
    • This is probably somewhat approximate and not super accurate, in particular
      for tests with very short test durations
  • acton test perf is now expanded and support all kinds of tests (previously
    only unit tests were supported)
    • some memory usage is printed alongside timing information
    • GC is run explicitly during perf test to get better memory usage stats but
      it also slows things down a bit, in particular for very short duration tests
  • acton test perf --record can save a performance snapshot to disk
    • Subsequent invocations of acton test perf will back the data from disk and
      display a comparison with percentage diff
  • AbE: testing documentation is much improved!
  • acton --only-build performs only the low level build from .C source,
    skipping compilation of .act files. This can be used if you want to modify the
    C source by hand and still leverage the low level builder to perform the build.
  • file.FS.cwd() to get current working directory
  • file.join_path() to join path components
  • Link time redirection of malloc & friends is now removed. All malloc calls are
    instead explicit, either directly to GC_MALLOC or via acton_malloc which
    is our own malloc function which is runtime reconfigurable. While there is no
    usage of malloc directly from our code, it is now possible to do manual
    memory management mixed with GC managed memory.
    • As before, module constants are placed in the regular heap, so that the GC
      does not have to scan it.
    • Many string formatting functions have been reshaped since asprintf does an
      implicit malloc, which we must either free or avoid. As a result, we now
      copy less data around, which speeds things up.
  • process.Process now takes an optional timeout argument to stop the process
  • New process.RunProcess that waits for a process to exit and then reports to
    a callback with the buffered output from stdout / stderr
    • This can provide a simpler interface than process.Process if you just want
      to wait for the process to finish running before starting to parse its
      output as you'll get a single invokation and the full output rather than
      receive it piecemeal
  • Add .unix_s() .unix_ms() .unix_us() .unix_ns() to time.Instant
    • To get a Unix timestamp (seconds since 1970-01-01 00:00:00), as seconds,
      milliseconds, microseconds or nanoseconds respectively
  • env.is_tty() to check if stdout is a TTY
  • acton.rts.start_gc_performance_measurement() to start a GC perf measurement
  • acton.rts.get_gc_time() to get the GC timings
  • env.is_tty() to check if stdout is a TTY
  • env.set_stdin(canonical: bool, echo: bool) to set stdin options
    • canonical is the default mode which is line buffered where the OS /
      terminal offers line editing capabilities and we only receive the input ones
      carriage return is hit
    • setting env.set_stdin(canonical=False) turns stdin into non-canonical mode
      where each character as entered is immediately forwarded to the stdin
      callback so we can react to it, great for interactive applications!
    • echo enables (the default) or disables echoing of characters
  • term improvements:
    • More grey shades
    • term.clear && term.top to clear and move cursor to top
  • http.Client.close() to explicitly close a connection
  • Single threaded RTS mode, only used by Windows for now

Changed

  • The work dir and environment arguments of process.Process have been moved to
    the end as they are optional, making it possible to invoke with fewer args
  • Tests run by acton test are now compiled with --dev and thus have C
    asserts enabled, similarly the test.hs that drives the test in the Acton repo
    now compile with --dev to get C asserts
  • acton test now runs test for at least 50ms
  • acton test perf now runs test for at least 1s
  • Rename --only-act to --skip-build
  • Acton build cache now uses up to 15GB instead of 5GB

Removed

  • actonc no longer supports --no-zigbuild / --zigbuild (it's now the
    default/only choice). It hasn't been tested in quite some time now and the zig
    build system works well enough that there is basically no reason to keep the
    old system around.
  • actonc no longer accepts --cc since we now always build using the zig
    build system which implies the clang version that Zig ships.
  • actonc no longer supports explicit --stub compilation, use --auto-stub

Fixed

  • key argument in KeyError(key) is now of type value, not list[None]
    which it was previously incorrect inferred as
  • file.WriteFile.write() now truncates file to avoid leftover tail of old
    content
  • time.Stopwatch().reset() now works
  • Test crashes are now handled
    • If the test program (e.g. ._test_foo) crashes from an assert or similar,
      the top test runner now captures this and reflects it in the output
  • Correct dependency path computation in builder
  • Makefile now more idempotent to avoid building when nothing has changed

Testing / CI

  • Test on MacOS 14 on Apple M1 / arm64 / aarch64
  • Many tests are now repeatedly 100 times to give some idea of stability