You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Andrea Del Bene <an...@gmail.com> on 2025/10/09 10:48:20 UTC

Re: Spicing Wicket up with more Lambda?

I think it might be useful creating a issue (or at least a branch) to
collect some ideas about this topic. I'll try to do something myself in the
next days.

On Thu, Jul 17, 2025 at 11:01 AM Andrea Del Bene <an...@gmail.com>
wrote:

> I'm in favor too of expanding Lambda adoption in Wicket. I remember some
> of this support was eventually moved to WicketStuff due to the memory
> concern, but I think it's better giving users the option to accept the
> right trade-off between memory consumption and a cleaner code.
>
> On Wed, Jul 16, 2025 at 1:25 PM Martijn Dashorst <
> martijn.dashorst@gmail.com> wrote:
>
>> On Tue, Jul 15, 2025 at 3:12 PM Richard Eckart de Castilho <
>> rec@apache.org>
>> wrote:
>>
>> > Does the memory usage matter a lot?
>>
>>
>> Yes. In (large) applications typically there's a lot of components in
>> memory.
>>
>> I'll dig up some statistics from one of our production servers with a lot
>> of users.
>>
>> Wrt. the this pointer: yeah, that sometimes comes up. However, most of the
>> > time
>> >
>> I fill in method handles anyway. In those cases where I don't I typically
>> > assign
>> > the component to a variable that I can use inside the lambda instead of
>> > the this.
>> > I had also thought of passing in the component as an argument to the
>> > lambda.
>> >
>>
>> The issue is that each lambda takes a reference which increases the
>> footprint of Component considerably. For a stateful serverside web
>> framework we can't ignore this.
>>
>> Joined the ASF channel ;)
>> >
>> > Do you think this is something limited to Wicket Bootstrap? Or would you
>> > just
>> > want to explore the concepts in that space before considering them for
>> > Wicket Core?
>> >
>>
>> It just came up in that channel. No particular reason.
>>
>> For whether or not it belongs to wicket proper? I dunno, but that is
>> something we should start discussing to get some new life in the project
>> other than the odd bugfix. The programming model hasn't really changed
>> since Java 5, so we're due a refresh.
>>
>> Martijn
>>
>
>
> --
> Andrea Del Bene.
> Apache Wicket committer.
>


-- 
Andrea Del Bene.
Apache Wicket committer.

Re: Spicing Wicket up with more Lambda?

Posted by Andrea Del Bene <an...@gmail.com>.
I see class Behavior already has 2 static factory methods to create
behaviors using lambdas: onTag and onAttribute. What about adding a similar
onConfigure method? I think this method alone could cover most of the cases
when we might like to use lambdas to control the state of a component.

On Mon, Oct 27, 2025 at 12:44 PM Martin Grigorov <mg...@apache.org>
wrote:

> Since this is completely new code and there are no changes in Wicket's
> old/existing classes I'd recommend pushing these classes to Wicketstuff
> Core first.
> Once the new behaviors are polished and popular, move them over to
> wicket-core.
>
> Being popular/used will give them some weight over the concerns that they
> will make the component tree heavier.
>
> My 2c.
>
> On Mon, Oct 27, 2025 at 12:21 PM Andrea Del Bene <an...@gmail.com>
> wrote:
>
> > On Tue, Oct 14, 2025 at 12:37 PM Richard Eckart de Castilho <
> > rec@apache.org>
> > wrote:
> >
> > > Thanks for the proposal.
> > >
> > > > On 13. Oct 2025, at 17:16, Andrea Del Bene <an...@gmail.com>
> > wrote:
> > > >
> > > >
> > >
> >
> https://github.com/apache/wicket/compare/master...bitstorm:wicket:lambda_spicing
> > >
> > > In your proposal, there are two classes "BehaviourBuilder" and
> > > "LambdaBehavior". The first always builds the latter. I would have
> > expected
> > > a "LambdaBehavior.builder()" factory method to create the builder and
> the
> > > builder being an internal class of the "LambdaBehavior".
> > >
> >
> > Right. Basically I like to keep LambdaBehavior available for those who
> want
> > to use directly in their code
> >
> >
> > >
> > > What I really like in your proposal is that all callbacks get the
> > > component as an argument, even "visibleWhen" and "enabledWhen".
> > >
> > > So an example using your approach:
> > >
> > >   import static BehaviorBuilder; // let's discount this line
> > >
> > >   component.add(BehaviorBuilder.newBuilder()
> > >     .visibleWhen(this::isEasterEggFound)
> > >     .enabledWhen(this::isEasterEggTriggered)
> > >     .build();
> > >
> > > In the current implementation of "LambdaBehavior" the "visibleWhen",
> > > "enabledWhen" and "onConfigure" methods seem to be mutually exclusive
> > > because they seem to override each other. If the idea is that the user
> > > would add a single "LambdaBehavior" to a component which covers
> multiple
> > > callbacks, then all of them should be usable.
> > >
> >
> > Yes, in this first implementation I did "visibleWhen", "enabledWhen" and
> > "onConfigure" methods are mutually exclusive. I think we should overcome
> > this limit working an the builder in order to remember the different
> > lambdas set by each method. In this way when we invoke build() we could
> > produce a single LambdaBehavior with the expected behavior.
> >
> >
> > >
> > > I (probably obviously) like the approach I had taken which uses static
> > > factory methods to create anonymous behaviours:
> > >
> > >   import static LambdaBehavior.*; // let's discount this line
> > >
> > >   component.add(visibleWhen(this::isEasterEggFound))
> > >   component.add(enabledWhen(this::isEasterEggTriggered))
> > >
> > > Drawback on approach compared to yours is of course that it spams
> > > anonymous behaviour instances - I'm sure people would call that
> > inefficient
> > > (so far, I don't really mind). But on the positive side, I save calls
> to
> > > creating the builder and finalizing the builder which makes the code
> > quite
> > > a bit less verbose (and I appreciate concise and readable code).
> > >
> > >
> > >
> >
> https://github.com/inception-project/inception/blob/0d825f3f52909fed1d8699686d2f8536f03e4403/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/lambda/LambdaBehavior.java#L167-L179
> > >
> > > Maybe a hybrid/merger of the two approaches (builder + factory methods)
> > > would be viable.
> > >
> > > For sugar on top:
> > >
> > > I found it useful to also have "enabled/visibleWhenNot" and variations
> of
> > > the "when" methods that take a "IModel<Boolean>" instead of a supplier.
> > >
> >
> > I will try to rielaborate the code when I will have some spare time...
> >
> > Bye!
> >
>


-- 
Andrea Del Bene.
Apache Wicket committer.

Re: Spicing Wicket up with more Lambda?

Posted by Martin Grigorov <mg...@apache.org>.
Since this is completely new code and there are no changes in Wicket's
old/existing classes I'd recommend pushing these classes to Wicketstuff
Core first.
Once the new behaviors are polished and popular, move them over to
wicket-core.

Being popular/used will give them some weight over the concerns that they
will make the component tree heavier.

My 2c.

On Mon, Oct 27, 2025 at 12:21 PM Andrea Del Bene <an...@gmail.com>
wrote:

> On Tue, Oct 14, 2025 at 12:37 PM Richard Eckart de Castilho <
> rec@apache.org>
> wrote:
>
> > Thanks for the proposal.
> >
> > > On 13. Oct 2025, at 17:16, Andrea Del Bene <an...@gmail.com>
> wrote:
> > >
> > >
> >
> https://github.com/apache/wicket/compare/master...bitstorm:wicket:lambda_spicing
> >
> > In your proposal, there are two classes "BehaviourBuilder" and
> > "LambdaBehavior". The first always builds the latter. I would have
> expected
> > a "LambdaBehavior.builder()" factory method to create the builder and the
> > builder being an internal class of the "LambdaBehavior".
> >
>
> Right. Basically I like to keep LambdaBehavior available for those who want
> to use directly in their code
>
>
> >
> > What I really like in your proposal is that all callbacks get the
> > component as an argument, even "visibleWhen" and "enabledWhen".
> >
> > So an example using your approach:
> >
> >   import static BehaviorBuilder; // let's discount this line
> >
> >   component.add(BehaviorBuilder.newBuilder()
> >     .visibleWhen(this::isEasterEggFound)
> >     .enabledWhen(this::isEasterEggTriggered)
> >     .build();
> >
> > In the current implementation of "LambdaBehavior" the "visibleWhen",
> > "enabledWhen" and "onConfigure" methods seem to be mutually exclusive
> > because they seem to override each other. If the idea is that the user
> > would add a single "LambdaBehavior" to a component which covers multiple
> > callbacks, then all of them should be usable.
> >
>
> Yes, in this first implementation I did "visibleWhen", "enabledWhen" and
> "onConfigure" methods are mutually exclusive. I think we should overcome
> this limit working an the builder in order to remember the different
> lambdas set by each method. In this way when we invoke build() we could
> produce a single LambdaBehavior with the expected behavior.
>
>
> >
> > I (probably obviously) like the approach I had taken which uses static
> > factory methods to create anonymous behaviours:
> >
> >   import static LambdaBehavior.*; // let's discount this line
> >
> >   component.add(visibleWhen(this::isEasterEggFound))
> >   component.add(enabledWhen(this::isEasterEggTriggered))
> >
> > Drawback on approach compared to yours is of course that it spams
> > anonymous behaviour instances - I'm sure people would call that
> inefficient
> > (so far, I don't really mind). But on the positive side, I save calls to
> > creating the builder and finalizing the builder which makes the code
> quite
> > a bit less verbose (and I appreciate concise and readable code).
> >
> >
> >
> https://github.com/inception-project/inception/blob/0d825f3f52909fed1d8699686d2f8536f03e4403/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/lambda/LambdaBehavior.java#L167-L179
> >
> > Maybe a hybrid/merger of the two approaches (builder + factory methods)
> > would be viable.
> >
> > For sugar on top:
> >
> > I found it useful to also have "enabled/visibleWhenNot" and variations of
> > the "when" methods that take a "IModel<Boolean>" instead of a supplier.
> >
>
> I will try to rielaborate the code when I will have some spare time...
>
> Bye!
>

Re: Spicing Wicket up with more Lambda?

Posted by Andrea Del Bene <an...@gmail.com>.
On Tue, Oct 14, 2025 at 12:37 PM Richard Eckart de Castilho <re...@apache.org>
wrote:

> Thanks for the proposal.
>
> > On 13. Oct 2025, at 17:16, Andrea Del Bene <an...@gmail.com> wrote:
> >
> >
> https://github.com/apache/wicket/compare/master...bitstorm:wicket:lambda_spicing
>
> In your proposal, there are two classes "BehaviourBuilder" and
> "LambdaBehavior". The first always builds the latter. I would have expected
> a "LambdaBehavior.builder()" factory method to create the builder and the
> builder being an internal class of the "LambdaBehavior".
>

Right. Basically I like to keep LambdaBehavior available for those who want
to use directly in their code


>
> What I really like in your proposal is that all callbacks get the
> component as an argument, even "visibleWhen" and "enabledWhen".
>
> So an example using your approach:
>
>   import static BehaviorBuilder; // let's discount this line
>
>   component.add(BehaviorBuilder.newBuilder()
>     .visibleWhen(this::isEasterEggFound)
>     .enabledWhen(this::isEasterEggTriggered)
>     .build();
>
> In the current implementation of "LambdaBehavior" the "visibleWhen",
> "enabledWhen" and "onConfigure" methods seem to be mutually exclusive
> because they seem to override each other. If the idea is that the user
> would add a single "LambdaBehavior" to a component which covers multiple
> callbacks, then all of them should be usable.
>

Yes, in this first implementation I did "visibleWhen", "enabledWhen" and
"onConfigure" methods are mutually exclusive. I think we should overcome
this limit working an the builder in order to remember the different
lambdas set by each method. In this way when we invoke build() we could
produce a single LambdaBehavior with the expected behavior.


>
> I (probably obviously) like the approach I had taken which uses static
> factory methods to create anonymous behaviours:
>
>   import static LambdaBehavior.*; // let's discount this line
>
>   component.add(visibleWhen(this::isEasterEggFound))
>   component.add(enabledWhen(this::isEasterEggTriggered))
>
> Drawback on approach compared to yours is of course that it spams
> anonymous behaviour instances - I'm sure people would call that inefficient
> (so far, I don't really mind). But on the positive side, I save calls to
> creating the builder and finalizing the builder which makes the code quite
> a bit less verbose (and I appreciate concise and readable code).
>
>
> https://github.com/inception-project/inception/blob/0d825f3f52909fed1d8699686d2f8536f03e4403/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/lambda/LambdaBehavior.java#L167-L179
>
> Maybe a hybrid/merger of the two approaches (builder + factory methods)
> would be viable.
>
> For sugar on top:
>
> I found it useful to also have "enabled/visibleWhenNot" and variations of
> the "when" methods that take a "IModel<Boolean>" instead of a supplier.
>

I will try to rielaborate the code when I will have some spare time...

Bye!

Re: Spicing Wicket up with more Lambda?

Posted by Richard Eckart de Castilho <re...@apache.org>.
Thanks for the proposal.

> On 13. Oct 2025, at 17:16, Andrea Del Bene <an...@gmail.com> wrote:
> 
> https://github.com/apache/wicket/compare/master...bitstorm:wicket:lambda_spicing

In your proposal, there are two classes "BehaviourBuilder" and "LambdaBehavior". The first always builds the latter. I would have expected a "LambdaBehavior.builder()" factory method to create the builder and the builder being an internal class of the "LambdaBehavior".

What I really like in your proposal is that all callbacks get the component as an argument, even "visibleWhen" and "enabledWhen".

So an example using your approach:

  import static BehaviorBuilder; // let's discount this line

  component.add(BehaviorBuilder.newBuilder()
    .visibleWhen(this::isEasterEggFound)
    .enabledWhen(this::isEasterEggTriggered)
    .build();

In the current implementation of "LambdaBehavior" the "visibleWhen", "enabledWhen" and "onConfigure" methods seem to be mutually exclusive because they seem to override each other. If the idea is that the user would add a single "LambdaBehavior" to a component which covers multiple callbacks, then all of them should be usable. 

I (probably obviously) like the approach I had taken which uses static factory methods to create anonymous behaviours:

  import static LambdaBehavior.*; // let's discount this line

  component.add(visibleWhen(this::isEasterEggFound))
  component.add(enabledWhen(this::isEasterEggTriggered))

Drawback on approach compared to yours is of course that it spams anonymous behaviour instances - I'm sure people would call that inefficient (so far, I don't really mind). But on the positive side, I save calls to creating the builder and finalizing the builder which makes the code quite a bit less verbose (and I appreciate concise and readable code).

  https://github.com/inception-project/inception/blob/0d825f3f52909fed1d8699686d2f8536f03e4403/inception/inception-support/src/main/java/de/tudarmstadt/ukp/inception/support/lambda/LambdaBehavior.java#L167-L179

Maybe a hybrid/merger of the two approaches (builder + factory methods) would be viable.

For sugar on top:

I found it useful to also have "enabled/visibleWhenNot" and variations of the "when" methods that take a "IModel<Boolean>" instead of a supplier.

Cheers,

-- Richard


Re: Spicing Wicket up with more Lambda?

Posted by Andrea Del Bene <an...@gmail.com>.
On Thu, Oct 9, 2025 at 9:46 PM Richard Eckart de Castilho <re...@apache.org>
wrote:

>
> Facilitating alternative ways of doing something doesn't mean the old /
> low-level
> approaches have to go away. I'm using quite a bit of lambdas with Wicket
> without having
> changed a single line of code in the core framework (although I have
> Lambda* variations of
> several key classes and components). Thing is, if I find this useful,
> maybe others will too.
> And what's the point of each of use maintaining our own versions of such
> lambda helpers and
> utilities.
>
> Let's figure out what ideas people have and where they best may go - be it
> Wicketstuff,
> a core extension, or the core itself. Mind that while the the core already
> does have a
> lambda support in a (very) few places, e.g. LambdaModel, nobody is force
> to use it.
> But it is there and it is at times quite useful.
>
> Cheerio,
>
> -- Richard
>
>
I agree with Richard. Lambdas are now more than 10 years old and I think we
experienced both pros and cos of this language idiom. I think it can be
useful for Wicket users if we expand lambdas adoption in a non-intrusive
way. Just like Martijn I'd like to introduce one or more builders to offer
a fluent API for the most common needs. I've sketched some code for a
behavior builder that should bring this kind of improvement. If you like to
take a look is here:

https://github.com/apache/wicket/compare/master...bitstorm:wicket:lambda_spicing

-- 
Andrea Del Bene.
Apache Wicket committer.

Re: Spicing Wicket up with more Lambda?

Posted by Richard Eckart de Castilho <re...@apache.org>.
... speaking of efficiency: full-quoting 5 levels of mail history just to add two wee lines way down? ... just saying.

In the good old days, we would quote only the necessary to avoid filling up precious mailbox space.

> On 9. Oct 2025, at 18:34, Martin Terra <ma...@tuntinetti.fi.INVALID> wrote:
>> On 9/10/2025 9:48 pm, Andrea Del Bene wrote:
>>> On Thu, Jul 17, 2025 at 11:01 AM Andrea Del Bene <an...@gmail.com> wrote:
>>>> On Wed, Jul 16, 2025 at 1:25 PM Martijn Dashorst <ma...@gmail.com> wrote:
>>>>> On Tue, Jul 15, 2025 at 3:12 PM Richard Eckart de Castilho <re...@apache.org> wrote:
>>>>> 
>>>>>> Does the memory usage matter a lot?
>> 
>> There's a reason Linux is still written, mostly, in 40 year old C. Some
>> recent efforts to convert some parts to the latest shiny thing, Rust
> 
> have ended up with lower performance than their C based originals.
> 
> 1+

Facilitating alternative ways of doing something doesn't mean the old / low-level
approaches have to go away. I'm using quite a bit of lambdas with Wicket without having
changed a single line of code in the core framework (although I have Lambda* variations of
several key classes and components). Thing is, if I find this useful, maybe others will too.
And what's the point of each of use maintaining our own versions of such lambda helpers and
utilities.

Let's figure out what ideas people have and where they best may go - be it Wicketstuff,
a core extension, or the core itself. Mind that while the the core already does have a
lambda support in a (very) few places, e.g. LambdaModel, nobody is force to use it.
But it is there and it is at times quite useful.

Cheerio,

-- Richard


Re: Spicing Wicket up with more Lambda?

Posted by Martin Terra <ma...@tuntinetti.fi.INVALID>.
to 9.10.2025 klo 19.11 Chris Colman (chrisc@stepaheadsoftware.com.invalid)
kirjoitti:

>
> On 9/10/2025 9:48 pm, Andrea Del Bene wrote:
> > I think it might be useful creating a issue (or at least a branch) to
> > collect some ideas about this topic. I'll try to do something myself in
> the
> > next days.
> >
> > On Thu, Jul 17, 2025 at 11:01 AM Andrea Del Bene <an...@gmail.com>
> > wrote:
> >
> >> I'm in favor too of expanding Lambda adoption in Wicket. I remember some
> >> of this support was eventually moved to WicketStuff due to the memory
> >> concern, but I think it's better giving users the option to accept the
> >> right trade-off between memory consumption and a cleaner code.
> >>
> >> On Wed, Jul 16, 2025 at 1:25 PM Martijn Dashorst <
> >> martijn.dashorst@gmail.com> wrote:
> >>
> >>> On Tue, Jul 15, 2025 at 3:12 PM Richard Eckart de Castilho <
> >>> rec@apache.org>
> >>> wrote:
> >>>
> >>>> Does the memory usage matter a lot?
> >>>
> >>> Yes. In (large) applications typically there's a lot of components in
> >>> memory.
> >>>
> >>> I'll dig up some statistics from one of our production servers with a
> lot
> >>> of users.
> >>>
> >>> Wrt. the this pointer: yeah, that sometimes comes up. However, most of
> the
> >>>> time
> >>>>
> >>> I fill in method handles anyway. In those cases where I don't I
> typically
> >>>> assign
> >>>> the component to a variable that I can use inside the lambda instead
> of
> >>>> the this.
> >>>> I had also thought of passing in the component as an argument to the
> >>>> lambda.
> >>>>
> >>> The issue is that each lambda takes a reference which increases the
> >>> footprint of Component considerably. For a stateful serverside web
> >>> framework we can't ignore this.
> >>>
> >>> Joined the ASF channel ;)
>
> Exactly. I know many of these new-ish language features are nice and
> shiny and "mathematically puritan" (if that's important) but we still
> have to consider that these apps must run on real computers and so the
> extra RAM, GC load and CPU cycles consumed have to be considered.
>
> We had an app that ran for years without any performance or reliability
> issues until one day a developer took it on himself to replace many low
> level methods that returned an object to return an 'Optional' typed to
> the object's type instead. It had payroll report generation code,
> iterating over hundreds of thousands of employees with 100 or so fields
> per employee record. The extra object (Optional instances) being created
> at every one of these previously efficient field level method calls
> caused the Garbage Collector to have a hernia and code that ran fine for
> years on modest hardware was suddenly throwing regular OOMs and having
> the system appear to freeze up.
>
> The OOMs were not the good type of OOM either - they were these bad boys:
>
> "Excessive Garbage Collection Time:
>
> If the JVM spends an inordinate amount of time on garbage collection
> (e.g., 98% of CPU time) and recovers very little memory (e.g., less than
> 2% of the heap), it can throw an OutOfMemoryError: GC overhead limit
> exceeded. This indicates that the application is making little progress
> and is primarily busy with garbage collection."
>
> As mentioned by others there are also issues with access to variables
> with shiny lambda's. Too many times I have thought a shiny lambda would
> nicely replace a simple 'for' loop only to discover that the non trivial
> code needed at each iteration required access to non "finalisable"
> variables in the outer method block and so then we have to invent
> intricate ways to provide access... at some point you realize the "nice
> and shiny" thing isn't something to be blindly adopted everywhere.
>
> There's a reason Linux is still written, mostly, in 40 year old C. Some
> recent efforts to convert some parts to the latest shiny thing, Rust

have ended up with lower performance than their C based originals.
>

1+


>
> Regards,
> Chrisco
>
> >>>> Do you think this is something limited to Wicket Bootstrap? Or would
> you
> >>>> just
> >>>> want to explore the concepts in that space before considering them for
> >>>> Wicket Core?
> >>>>
> >>> It just came up in that channel. No particular reason.
> >>>
> >>> For whether or not it belongs to wicket proper? I dunno, but that is
> >>> something we should start discussing to get some new life in the
> project
> >>> other than the odd bugfix. The programming model hasn't really changed
> >>> since Java 5, so we're due a refresh.
> >>>
> >>> Martijn
> >>>
> >>
> >> --
> >> Andrea Del Bene.
> >> Apache Wicket committer.
> >>
> >
>

Re: Spicing Wicket up with more Lambda?

Posted by Chris Colman <ch...@stepaheadsoftware.com.INVALID>.
On 9/10/2025 9:48 pm, Andrea Del Bene wrote:
> I think it might be useful creating a issue (or at least a branch) to
> collect some ideas about this topic. I'll try to do something myself in the
> next days.
>
> On Thu, Jul 17, 2025 at 11:01 AM Andrea Del Bene <an...@gmail.com>
> wrote:
>
>> I'm in favor too of expanding Lambda adoption in Wicket. I remember some
>> of this support was eventually moved to WicketStuff due to the memory
>> concern, but I think it's better giving users the option to accept the
>> right trade-off between memory consumption and a cleaner code.
>>
>> On Wed, Jul 16, 2025 at 1:25 PM Martijn Dashorst <
>> martijn.dashorst@gmail.com> wrote:
>>
>>> On Tue, Jul 15, 2025 at 3:12 PM Richard Eckart de Castilho <
>>> rec@apache.org>
>>> wrote:
>>>
>>>> Does the memory usage matter a lot?
>>>
>>> Yes. In (large) applications typically there's a lot of components in
>>> memory.
>>>
>>> I'll dig up some statistics from one of our production servers with a lot
>>> of users.
>>>
>>> Wrt. the this pointer: yeah, that sometimes comes up. However, most of the
>>>> time
>>>>
>>> I fill in method handles anyway. In those cases where I don't I typically
>>>> assign
>>>> the component to a variable that I can use inside the lambda instead of
>>>> the this.
>>>> I had also thought of passing in the component as an argument to the
>>>> lambda.
>>>>
>>> The issue is that each lambda takes a reference which increases the
>>> footprint of Component considerably. For a stateful serverside web
>>> framework we can't ignore this.
>>>
>>> Joined the ASF channel ;)

Exactly. I know many of these new-ish language features are nice and 
shiny and "mathematically puritan" (if that's important) but we still 
have to consider that these apps must run on real computers and so the 
extra RAM, GC load and CPU cycles consumed have to be considered.

We had an app that ran for years without any performance or reliability 
issues until one day a developer took it on himself to replace many low 
level methods that returned an object to return an 'Optional' typed to 
the object's type instead. It had payroll report generation code, 
iterating over hundreds of thousands of employees with 100 or so fields 
per employee record. The extra object (Optional instances) being created 
at every one of these previously efficient field level method calls 
caused the Garbage Collector to have a hernia and code that ran fine for 
years on modest hardware was suddenly throwing regular OOMs and having 
the system appear to freeze up.

The OOMs were not the good type of OOM either - they were these bad boys:

"Excessive Garbage Collection Time:

If the JVM spends an inordinate amount of time on garbage collection 
(e.g., 98% of CPU time) and recovers very little memory (e.g., less than 
2% of the heap), it can throw an OutOfMemoryError: GC overhead limit 
exceeded. This indicates that the application is making little progress 
and is primarily busy with garbage collection."

As mentioned by others there are also issues with access to variables 
with shiny lambda's. Too many times I have thought a shiny lambda would 
nicely replace a simple 'for' loop only to discover that the non trivial 
code needed at each iteration required access to non "finalisable" 
variables in the outer method block and so then we have to invent 
intricate ways to provide access... at some point you realize the "nice 
and shiny" thing isn't something to be blindly adopted everywhere.

There's a reason Linux is still written, mostly, in 40 year old C. Some 
recent efforts to convert some parts to the latest shiny thing, Rust 
have ended up with lower performance than their C based originals.

Regards,
Chrisco

>>>> Do you think this is something limited to Wicket Bootstrap? Or would you
>>>> just
>>>> want to explore the concepts in that space before considering them for
>>>> Wicket Core?
>>>>
>>> It just came up in that channel. No particular reason.
>>>
>>> For whether or not it belongs to wicket proper? I dunno, but that is
>>> something we should start discussing to get some new life in the project
>>> other than the odd bugfix. The programming model hasn't really changed
>>> since Java 5, so we're due a refresh.
>>>
>>> Martijn
>>>
>>
>> --
>> Andrea Del Bene.
>> Apache Wicket committer.
>>
>