Revision history for Future-AsyncAwait

0.66    2023-09-08
         * Add a unit test to check that `async method` works on core perl
           class syntax
         * Remember to implement `sub unimport` so that `no Future::AsyncAwait`

         * Provide a permit_hintkey to keep XPS happy

0.65    2023-03-17
         * More specific unit-testing of the croak location when testing
           `AWAIT_GET` (related to RT145249)
         * Swap all unit tests from `Test::More` to `Test2::V0`
         * Avoids test_requires on `Test::Refcount` or `Test::Fatal`

         * A more robust handling of defav during suspend/resume to try not to
           upset `perl -d` (RT146246)

0.64    2023-02-14
         * Define ABI version 2, which adds pre_suspend and post_resume phase

0.63    2023-02-12
         * Added various bits of API to extension modules using modhookdata more
           flexibly, including by pre-allocation before the first `await`
         * Legacy hook API now prints warnings about its deprecation and
           impending removal

         * Bleadperl no longer supports `GIMME`, in any case should use
         * Fix memory leak around pre-allocated cancel AV

0.62    2022-12-20
         * Save/restore the value of the @_ array; does not work on perls
           before 5.24 for reasons unknown (RT130683)
         * Updated hax/ files to avoid a build warning on current bleadperl

0.61    2022-11-21
         * Fix for some C compilers which get upset about variable
           declarations having goto labels

0.60    2022-11-21
         * Added entirely new extension API based on structs of hook functions
           registered with the module; similar to Object::Pad and XS::Parse::*
         * Provide Future::AsyncAwait::ExtensionBuilder in a similar fashion
           to above
         * Added some more internal assert() and TRACEPRINT calls for

         * Don't crash if an async sub's returning future is abandoned outside
           of an await state

0.59    2022-09-23
         * Fix broken Future->get method resolution on recent
           Future + Future::XS experiments
         * Fix hax/ for "NULL OP IN RUN" messages
         * Make t/31destroy.t less fragile in the case of non-HASH Future
         * Back-compat to perl 5.16 by passing `flags` arg to `cv_copy_flags`

0.58    2022-04-29
         * Fix memory leak with long-running futures and on_cancel (RT142222)
         * Copy SVs with SvPADTMP in case of running code, or folded constants
           that erroneously end up with that flag anyway (RT142468)

0.57    2022-03-16
         * Updates for Devel::MAT::Dumper v0.44
         * Updates to bundled hax/ files

0.56    2022-01-26
         * Updated Awaitable API definition for AWAIT_ON_CANCEL
         * Actually use AWAIT_ON_CANCEL properly (RT137723)
         * Document the interaction of `multi async sub`

0.55    2021-12-16
         * Updated for XS::Parse::Keyword 0.15
         * Hoist an OP_ARGCHECK to outside the ENTERTRY block if present, so
           that signature validation happens synchronously
         * Support and unit-test Syntax::Keyword::MultiSub
         * No longer set `-std=c89` compile flag now that core perl requires
           C99 anyway

0.54    2021-10-26
         * Add unit-test for await from within perl 5.35.5's multi-variable
           `for_list` feature
         * Add cross-module test for compatibility with Syntax::Keyword::Match

         * Handle `state` vars correctly (RT139821)

0.53    2021-08-26
         * Updated for XS::Parse::Keyword 0.13

0.52    2021-07-13
         * Account for changed error message from XS::Parse::Keyword 0.09

0.51    2021-05-31
         * Updates for XS::Parse::Keyword 0.05
         * Removed unused hax/* files

0.50    2021-04-30
         * Rewrite of parser logic to use XS::Parse::Keyword instead of
           lowlevel code on PL_keyword_parser directly
         * Attempt to provide a name for the local'ized GV that cannot be
           handled (thanks fgasper)
         * Attempt to provide a name for SAVEt_* constants that cannot be
         * Added a shouty AWAIT_WAIT method to implement toplevel `await`
         * Docs update - remark that Rust and C++20 have async/await too

         * Invoke defer {} and finally {} blocks on cancellation (RT135351)

0.49    2021-02-24
         * Handle the CXp_TRY and real try/catch syntax added in perl 5.33.7

0.48    2021-02-02
         * Explicitly document that `async sub` works on anon subs too
         * Update to latest hax/ files

         * t/80await+try.t requires Syntax::Keyword::Try version >= 0.18

0.47    2020-11-29
         * Allow `await` expressions at toplevel of main script, for
           consistency of examples, unit tests, etc... (RT129306)

0.46    2020-11-09
         * Provide future_asyncawait_on_activate() in AsyncAwait.h
         * Adjusted docs around new `AWAIT_CHAIN_CANCEL` method
         * Depend on Future 0.43 for Awaitable role named methods, rather than
           monkey-patching older versions

0.45    2020-10-22
         * Have Test::Future::AsyncAwait::Awaitable check for the suggested
           new `AWAIT_CHAIN_CANCEL` method

         * Avoid refcounting bug when cancelling a suspended SAVEt_SPTR
         * Turn on SvPADMY on precancel AV to keep -DDEBUGGING perl happy

0.44    2020-10-09
         * Added initial attempt at `CANCEL` blocks for handling Future
           cancellation - experimental
         * Announce upcoming API method rename of `AWAIT_ON_CANCEL` to

0.43    2020-07-06
         * Added explicit use VERSION declarations to every perl file

         * Don't segfault when awaiting in closures that capture outer 'our'
           variables (RT132945)

0.42    2020-06-29
         * Fixes for assert failures on -DDEBUGGING perls:
            + Workarounds for perl versions prior to 5.22 that get upset about
              new*OP() being invoked with OP_CUSTOM
            + Remember to set SVs_PADMY flag on newly-generated pad slot SVs
              during suspend
         * Don't leak SVs when cleaning up SAVEt_FREESV during cancellation

0.41    2020-06-20
         * Updates for XS::Parse::Sublike 0.10

         * Fix Build.PL declaration on XS::Parse::Sublike that it needs to be

0.40    2020-04-15
         * Support a limited form of SAVEt_SPTR when the var is within the
           current pad; this supports SAVESPTR(PAD_SVl(padix)) as may be used
           by Object::Pad

0.39    2020-03-27
         * Updated for XS::Parse::Sublike 0.06 API

0.38    2020-03-24
         * Use XS::Parse::Sublike for `async sub` parsing. This makes it
           possible to coƶperate with other sub-like keyword modules
         * Add cross-module test sthat module works correctly with Object::Pad,
           and additionally Syntax::Keyword::Dynamically as well

0.37    2020-03-10
         * Minor reƤrrangement of internal stages to closer match core's
           sub parser and allow more generic hooking in future

         * Don't allow a space between attr name and optional parenthesized
           argument (RT131571)

0.36    2020-01-16
         * Add an optional 'force' callback to test_awaitable()

         * Fix more segfault cases during compile failures
           (RT129987, RT131487)

0.35    2020-01-07
         * Support lexical scopes declaring a different class of future
         * Document the required API for awaitable objects
         * Provide an API conformance test for implementors of alternative
           future classes

         * Provide scalar context to controlling expression of `await`

0.34    2019-12-01 01:45:23
         * Various internal changes to neaten up the hax/ directory of C
           source files, letting them be more shareable with other XS dists

         * Fix (some of the cases of) RT129987
         * Only fetch CX_CUR() after the future_done_from_stack() call

0.33    2019-09-08 05:16:05
         * Remember to SPAGAIN after future_done_from_stack() in case the
           stack array was moved (RT130464)

0.32    2019-09-03 17:00:35
         * Define a super-experimental C-level API for other modules to hook
           parts of the suspend/resume lifecycle to provide extension

         * Actually use perl's own `wrap_keyword_plugin()`
         * Avoid compiler warning about int/IV mismatch in printf (RT130285)
         * Use warn_sv() to avoid compiler wraning about formatless warn() on
           a plain PV (RT130285)
         * Don't segfault on parse errors from parse_block() (RT130417)

0.31    2019-07-25 15:09:04
         * Use `parse_subsignature()` on bleadperl and backport it to
           perl 5.26, allowing parsing of subroutine signatures (RT123465)

0.30    2019-07-05 16:09:02
         * Parse attribute lists on `async sub`s (RT129985)

0.29    2019-06-26 20:23:12
         * Further annotations in Devel::MAT::Dumper helper about loop state

         * Fix various memory leaks of abandoned `async sub`s (RT129836)

0.28    2019-06-17 17:06:18
         * Fix localisation of hints hash at compiletime so nested `async sub`
           works correctly (RT129836)

0.27    2019-06-04 20:48:42
         * Detect certain forbidden constructs at compile-time; await inside:
            + non-lexical foreach
            + map and grep (RT129748)
            + string-eval (RT126036)

         * Preserve regexp context across await boundary (RT129321)

0.26    2019-04-27 12:41:11
         * Further fixes for foreach(LIST) handling (RT129319)
         * Handle SAVEt_FREEPV (RT129320)
         * Cleanup itervar and SAVEt_PADSV_AND_MORTALIZE of abandoned futures
         * Ensure body of async sub starts with OP_NEXSTATE so as not to upset
           Devel::Cover (thanks ilmari) (RT128309)

0.25    2019-04-24 15:46:15
         * Print a warning but don't panic on resume with lost returning
           future (RT129303)

0.24    2019-04-18 23:47:56
         * Stop `async sub`s on ->cancel (RT129202)
         * Propagate ->cancel requests back to awaiting future, though at
           present only on perl 5.24+ (RT129202)
         * Added more internal consistency checks and `panic()` assertions

         * Further fixes for broken behaviour of `foreach(LIST)` (RT129215)
         * Fix Devel::MAT::Dumper helper for expired but unreclaimed magic

0.23    2019-04-16 01:08:34
         * Many improvements to mortals handling, including workarounds for
           lack of cx->old_tmpsfloor on perls before 5.24 (RT128619)

0.22    2019-04-02 00:12:47
         * More detailed annotations in Devel::MAT::Dumper helper

         * Partial attempt at freeing things when dropping a pending await
           future (RT128620)
         * Fix for labeled loop controls (RT128205)

0.21    2019-02-02 17:19:35
         * Fix more memory leaks - simple test case now executes cleanly

0.20    2019-01-16 22:34:20
         * Ensure mortal SVs aren't reclaimed prematurely during
         * Fix several memory leaks. Some still remain but overall the
           situation is much improved (RT128222)

0.19    2019-01-08 23:49:03
         * Replace stolen array or hash pad lexicals with newAV() / newHV() to
           maintain the expected SvTYPE() invariants (RT128176)

0.18    2019-01-05 20:08:38
         * Declare threaded perls before version 5.22 as unsupported. The bug
           remains open but for now I'm disinclined to look into it. (RT124351)

         * Don't panic about blk_eval.old_eval_root or .cur_text fields, as it
           seems we can safely ignore those (RT126036)

0.17    2019-01-04 18:45:22
         * Perl 5.26 and above still needs SvREFCNT_inc() on the state array
           in CXt_LOOP_ARR (RT124353)
         * Better fix for scopestack name tracking under -DDEBUGGING
         * Set -DNO_XSLOCKS in order to get working JMPENV on MSWin32

0.16    2019-01-03 22:09:28
         * Use ENTER_with_name/LEAVE_with_name variants for easier debug (thanks
         * Don't clone the CVf_CVGV_RC flag
         * Unit-test that async/await also behaves fine through nested named
           method calls
         * Unit-test die after single await()

         * Avoid call to non-public unshare_hek() function (RT125613)
         * Remember to wrap pp_await in docatch() if CATCH_GET is true. Fixes
           many failing test cases (double-nested await, RT126037, RT123062)

0.15    2018-01-24 04:12:04
         * Support older perls back to 5.16 (continues work on RT122252). Just
           5.14 remains unsupported now
         * Neater implementation which avoids hacky workarounds from abusing

         * Avoid using anonymous union in struct SuspendedFrame (thanks ilmari)

0.14    2018-01-22 04:42:02
         * Document and test that 'await' works from inside 'do {}'
         * Test that two nested 'async sub's can await nicely

         * Fix for 'await' twice inside the same 'foreach' loop (RT124144)
         * Fix handling of ITERVAR save/restore on perl 5.24+
         * Use correct printf format for IVs when debug printing
         * Ensure that captured lexicals from now-dead scopes remain working

0.13    2018-01-18 15:52:03
         * Support older perls back to 5.18 (continues work on RT122252)
         * Ensure that 'async sub' called in list context doesn't leak its
           input arguments as well as Future result

0.12    2018-01-15 19:02:42
         * Support older perls back as far as 5.20 and 5.22
           (partly solves RT122252)
         * Link to TPCiA talk recording on youtube

0.11    2018-01-07 16:35:25
         * Fixes for markstack restoration calculation
         * Don't save/restore PAD slots relating to outer captures or
           protosubs (RT124026)

0.10    2017-08-13 23:25:33
         * Implement enough of SAVEt_DESTRUCTOR_X to make try/finally work
         * Fix the remaining integration tests with Syntax::Keyword::Try now
           latest version (0.07) works correctly

0.09    2017-08-13 17:44:48
         * Link to TPCiA talk slides
         * Forbid the use of foreach loops on non-lexicals as that has
           semantic problems due to the implied 'local'
         * Unit-test that plain 'eval{}' works as expected
         * Allow specifically the use of 'local $@' to support common patterns
           around 'eval{}'
         * Unit-test that try/catch from Syntax::Keyword::Try works
         * Save cx->blk_gimme on CXt_LOOP_* contexts (thanks rurban)

0.08    2017/08/10 16:48:52
         * Handle the other CXt_LOOP_* context types, making foreach() loops

0.07    2017/07/11 23:26:48
         * Forbid the use of 'await' outside of 'async sub'
         * Handle CXt_BLOCK contexts
         * Handle SAVEt_CLEARSV and SAVEt_CLEARPADRANGE savestack entries
         * Further documentation rework

         * Fix off-by-one error on reading the savestack, resulting in a
           number of false-"TODO" failures being fixed
         * Fix parser logic for parenthesized 'await( ... )' expressions

0.06    2017/06/29 17:43:19
         * Support suspend/resume within while loops and plain loop blocks
         * Import the syntax keywords by default, rather than having to
           request them as an import symbol
         * Added some initial documentation to explain the new syntax

         * Declare (for now) dependency on perl 5.24 to prevent older versions
           from attempting it and failing. We hope to support older versions
           back to 5.14 in due course.

0.05    2017/06/27 15:20:54
         * Fix await op so it can await multiple times within the same sub

0.04    2017/06/06 18:42:15
         * Suspend and resume the PAD around an await so lexical variables are
         * Ensure that anon async subs can suspend/resume - see also
         * Ensure MARK stack doesn't upset debugperl

0.03    2017/05/08 21:33:46
         * Handle the value and mark stacks around suspend/await, allowing
           some stack temporaries to be preserved
         * Avoid naming internal functions "Perl_..."

         * Ensure that die after await is still caught
         * Avoid C++-style comments and C99-style for() loop variable declarations

0.02    2017/05/08 16:55:38
         * Initial tiny implementation of actual suspend/resume on 'await'