Though I do very much appreciate C#, with its lambda functions, expression trees, and especially the tooling, Free Pascal and Lazarus exist as a happy compromise between those things and native code integration, where working with C libraries like libcairo, libxml2, libssl, libsdl, and opengl are much easier and a pleasure to work with when using Free Pascal, and conversely are more difficult to wrangle when using C# or Java.
Anonymous methods are the ones that are implemented via an interfaced object. It is a bit odd and I wish they had chosen something more ABI-compatible with a C++ functor, since it would have made mapping between the two easier IMO.
I have a test branch of the Oxygene compiler -- no idea if we'll merge it in, we make syntax experiments regularly -- where all callables are assignment-compatible. In Delphi terms this means assigning an anon method to an event handler would work, but equally for us, lambdas, blocks, and more. The idea is somewhat C++-like in terms of std::function and std::bind but with simple syntax in that you write it and it works: if it can be called, it can be applied where any callable method-like expectation exists.
I hope in time it also adopts the dynamic packages work in this thread.
There is some interesting innovation going on in the Pascal community (including AI, ML, Agent frameworks etc) - it is just not very visible in the wider tech world.
> There is some interesting innovation going on in the Pascal community
Links please :)
Coding agent inside Lazarus: https://forum.lazarus.freepascal.org/index.php/topic,75061.0...
Deep learning in Pascal: https://github.com/joaopauloschuler/neural-api
AI orchestration: https://github.com/gustavoeenriquez/MakerAi/tree/fpc
AI agent framework: https://github.com/FMXExpress/PasClaw
New Object Pascal compiler: https://github.com/graemeg/blaise
A lot more can be discovered on https://forum.lazarus.freepascal.org/
have fun!