You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2026/07/11 04:56:19 UTC

(groovy-website) branch asf-site updated (490e346 -> 83b0540)

This is an automated email from the ASF dual-hosted git repository.

paulk-asert pushed a change to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git


    from 490e346  GEP-27: note the DISABLED opt-out in the per-closure-control deferred-feature row
     new 21d070b  GEP-27: mark the SAM lambda slice as merged; fix the lambda flag name
     new 8c7419a  GEP-27: finish the merged-status pass for the lambda reference-implementation text
     new 83b0540  GEP-27: update the closure reference-implementation to the current state

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 site/src/site/wiki/GEP-27.adoc | 46 +++++++++++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 19 deletions(-)


(groovy-website) 02/03: GEP-27: finish the merged-status pass for the lambda reference-implementation text

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk-asert pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git

commit 8c7419af0e86988dc0c57407147520fb78ee8493
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Jul 11 14:52:38 2026 +1000

    GEP-27: finish the merged-status pass for the lambda reference-implementation text
    
    Mark the reference-implementation lambda bullet and Piece 2 as merged (were
    'candidate'/'on the first-step branch'), and note the pre-hoist bytecode-shape
    tests are skipped under the opt-in flag with migration deferred to a default
    flip -- rather than described as remaining first-step work.
---
 site/src/site/wiki/GEP-27.adoc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/site/src/site/wiki/GEP-27.adoc b/site/src/site/wiki/GEP-27.adoc
index b1b21fd..c73b107 100644
--- a/site/src/site/wiki/GEP-27.adoc
+++ b/site/src/site/wiki/GEP-27.adoc
@@ -389,8 +389,8 @@ class-visitor changes the closure work needs.
 A capturing SAM lambda today instantiates its lambda class to hold the captured values (Groovy
 even `Reference`-wraps them). The Java-style form uses a `static` implementation method taking the
 captured values as leading arguments, with the metafactory capturing them directly — which _also_
-removes the `Closure` allocation and the `Reference` wrapping. This is implemented on the same
-first-step branch for the *read-only* capture case (the common one): captured values are passed as
+removes the `Closure` allocation and the `Reference` wrapping. This is merged for the *read-only*
+capture case (the common one): captured values are passed as
 typed leading parameters. A lambda that *mutates* a capture still needs the shared `Reference`, so
 it correctly declines and keeps its class. This lands the bulk of the capturing benefit in Groovy 6
 behind the same flag; only mutated-capture lambdas remain on the class-based path.
@@ -543,7 +543,7 @@ build, so they remain open items before the flag defaults on:
 A proof-of-concept exists as a spike in the code generator, exercised through this proposal's
 development:
 
-* *Lambda first step (Groovy 6 candidate).* Implemented in `StaticTypesLambdaWriter`: both
+* *Lambda first step (Groovy 6, merged).* Implemented in `StaticTypesLambdaWriter`: both
   non-capturing *and* read-only-capturing SAM lambda classes are eliminated, with the impl hoisted
   to `private static` methods on the enclosing class (captured values become leading parameters)
   and the metafactory bootstrapped directly against them — the non-capturing case yielding a
@@ -551,9 +551,9 @@ development:
   methods are confirmed to carry full debug metadata (see _IDE and tooling considerations_). Cases
   that need the shared `Reference` or closure identity — mutated captures, instance access,
   serializable and nested-function lambdas — correctly decline and keep their class. The whole
-  first step sits behind the `groovy.target.lambda.hoist` flag. The existing lambda tests that
-  assert the old bytecode shape need updating to the new structure (behaviour is unchanged); that
-  test migration is the bulk of the remaining first-step work.
+  first step is merged behind the opt-in `groovy.target.lambda.hoist` flag; the lambda tests that
+  assert the old bytecode shape are skipped under the flag, with their migration to the new
+  structure deferred to when the default flips.
 * *Closure packing (Groovy 7 direction).* A `ClosureWriter`-based spike (with a shared
   `PackedClosure` runtime adapter), opt-in via `@PackedClosures`, demonstrates hoisting closures — captures,
   arbitrary-depth nesting, written captures via `Reference`, implicit `it` — under both compilation


(groovy-website) 01/03: GEP-27: mark the SAM lambda slice as merged; fix the lambda flag name

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk-asert pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git

commit 21d070b62e3b91cc8ac9af62b15de0867c450940
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Jul 11 14:51:33 2026 +1000

    GEP-27: mark the SAM lambda slice as merged; fix the lambda flag name
    
    The lambda hoisting (GROOVY-12143) and warning printing (GROOVY-12132) landed in
    master. Update the doc to match: the Groovy 6.0 deliverables and both Pieces are
    marked merged (was 'pending'/'primary'/'implemented'), the intro says merged
    (was 'on the first-step branch'), and the flags table now names the actual flag
    'groovy.target.lambda.hoist' (opt-in, off by default) rather than the never-used
    'groovy.target.lambda.hoist.disabled' opt-out form.
---
 site/src/site/wiki/GEP-27.adoc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/site/src/site/wiki/GEP-27.adoc b/site/src/site/wiki/GEP-27.adoc
index a9398ee..b1b21fd 100644
--- a/site/src/site/wiki/GEP-27.adoc
+++ b/site/src/site/wiki/GEP-27.adoc
@@ -14,7 +14,7 @@
 *Comment*:: Reduces the per-closure/per-lambda generated-class explosion by hoisting bodies onto the enclosing class. A small, sound-by-construction slice potentially targets Groovy 6; the broader closure work targets Groovy 7. Strictly additive; gated by a flag for back-out.
 *Leader*:: Paul King
 *Created*:: 2026-07-09
-*Last modification*:: 2026-07-10
+*Last modification*:: 2026-07-11
 ****
 
 [width="80%",align="center"]
@@ -347,13 +347,13 @@ fully self-contained — every free name binds to the owner or its own parameter
 delegate-independent and safe to pack even where it escapes; exploiting that for nested closures
 needs owner-correct retargeting, see _Reference implementation_.)
 
-== Groovy 6.0 deliverables (pending discussion and findings)
+== Groovy 6.0 deliverables (merged)
 
 The Groovy 6 target is the sound-by-construction slice: eliminating the generated class for SAM
-lambdas. Both pieces below are implemented on the first-step branch behind a single flag; the
-mutated-capture and serializable cases correctly stay on the class-based path.
+lambdas. Both pieces below are merged (GROOVY-12143), behind the opt-in `groovy.target.lambda.hoist`
+flag; the mutated-capture and serializable cases correctly stay on the class-based path.
 
-=== Piece 1 (primary): eliminate the class for non-capturing SAM lambdas
+=== Piece 1 (merged): eliminate the class for non-capturing SAM lambdas
 
 For a statically compiled, *non-capturing*, non-serializable lambda targeting a functional
 interface, do what Java does: emit the body as a `private static` synthetic method on the
@@ -384,7 +384,7 @@ method onto the enclosing class). It requires no change to the `invokedynamic`/m
 bootstrap other than the implementation method's owner class, and does not require the
 class-visitor changes the closure work needs.
 
-=== Piece 2 (implemented): read-only-capturing SAM lambdas
+=== Piece 2 (merged): read-only-capturing SAM lambdas
 
 A capturing SAM lambda today instantiates its lambda class to hold the captured values (Groovy
 even `Reference`-wraps them). The Java-style form uses a `static` implementation method taking the
@@ -443,9 +443,9 @@ means byte-for-byte today's behaviour.
 
 [cols="2,2,2"]
 |===
-|Concern |Flag (proposed) |Default
+|Concern |Flag |Default
 
-|Non-capturing SAM lambda hoisting (Groovy 6) |`groovy.target.lambda.hoist.disabled` |off (i.e. hoisting *on*), opt-out
+|SAM lambda hoisting (Groovy 6, merged) |`groovy.target.lambda.hoist` |off (opt-in)
 |Closure packing under `@CompileStatic` (Groovy 7) |`groovy.target.closure.pack` (+ per-scope `@PackedClosures`) |to be decided per release
 |Closure packing under dynamic compilation |`@PackedClosures` opt-in only |off unless annotated
 |===


(groovy-website) 03/03: GEP-27: update the closure reference-implementation to the current state

Posted by pa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

paulk-asert pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git

commit 83b0540d411d8121a16a476984dd2b629e788730
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sat Jul 11 14:54:11 2026 +1000

    GEP-27: update the closure reference-implementation to the current state
    
    All three safety layers are now implemented (add the decline-diagnostics layer);
    the capability analysis and typed static dispatch are implemented and validated
    (compile-time packing across the core module and others), so the remaining Groovy
    7 work is restated as S3 elision, writer unification, nested-closure owner
    retargeting, and hardening the automatic path from experimental to default-on.
---
 site/src/site/wiki/GEP-27.adoc | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/site/src/site/wiki/GEP-27.adoc b/site/src/site/wiki/GEP-27.adoc
index c73b107..a342236 100644
--- a/site/src/site/wiki/GEP-27.adoc
+++ b/site/src/site/wiki/GEP-27.adoc
@@ -559,8 +559,8 @@ development:
   arbitrary-depth nesting, written captures via `Reference`, implicit `it` — under both compilation
   modes. It confirms the writer is the right home (no `@CompileStatic` boundary, unlike an
   AST-transform approach), establishes the soundness cliff empirically, and confirms what is
-  preserved (`curry`/`memoize`/`trampoline` all keep working on the adapter). Two of the three
-  safety layers from _Guarding the dynamic trust assertion_ are now implemented and validated:
+  preserved (`curry`/`memoize`/`trampoline` all keep working on the adapter). All three safety layers
+  from _Guarding the dynamic trust assertion_ are now implemented and validated:
 ** the *runtime guard* — `PackedClosure` rejects `setDelegate`/`setResolveStrategy` set to any
    non-owner configuration. Probing confirmed every delegate-redirect path (`with`/`tap`,
    `rehydrate`, builder DSLs, DGM) funnels through those two setters, so the guard turns what was a
@@ -570,9 +570,17 @@ development:
    into a field/property/index, returned, appended with `<<`, or placed in a collection literal) is
    kept as a class, moving the clearest delegate-risk cases from a runtime throw to a compile-time
    non-event.
-
-The remaining Groovy 7 work is the *capability/escape analysis* for the `@CompileStatic` automatic
-path (proving packing sound so no annotation is needed) and typed static dispatch.
+** the *decline diagnostics* — `@PackedClosures(mode = WARN | STRICT)` surfaces closures that could
+   not be packed (a compiler warning or error, with the reason and source position); `DISABLED` opts
+   a scope out entirely. The automatic flag path stays lenient.
+
+Also implemented and validated: the *capability analysis* (STC's delegate-independence proof driving
+automatic packing under `@CompileStatic`, no annotation needed) and *typed static dispatch*
+(statically-compiled hoisted bodies with typed captures/params/return — zero `invokedynamic`), with
+compile-time packing exercised across the core module and several others. The remaining Groovy 7
+work is S3 object elision, unifying the closure and lambda writers, owner-correct retargeting so
+nested closures can hoist, and hardening the automatic path from experimental (opt-in flag) to
+default-on.
 
 === Measured impact