So while I'm not exactly user of Lazarus other developer on our humble open source project uses it for our map editor. Screenshots might look dated and ugly, but it's much closer to being working solution for cross-platform desktop applications than many would imagine it to be.
Pros: super easy to serialize data, compilation is fast, easy to avoid crashes.
Cons: version packaged in Debian is far from perfect, some UI bindings are not very stable on macOS for instance.
Actually it does have automatic destructors, they're just not the default option.
The first way to auto destroy objects is to expose an Interface and free your object in the Release method. You can inherit from several class types that already do that if you don't want to rewrite a new class.
The second way is a newer feature that allows you to define Initiazlize and Finalize methods on any complex type. When you define these methods, the compiler generates code to reference count your object and call Initazlize on create, and Finalize when your object is no longer referenced. This works the same on stack based types as well as heap allocated types.
Sweet!
The docs say "since version 3.1.1", and the latest release seems to be 3.0.4, so I guess this has not been released yet?
Do you think that the changes help with simpler algorithms -- like in StringHashList [0], where destructor specifically calls Dispose on each array element, and then deletes the array storage itself?
The odd minor versions are never released as official builds, but they are official versions. You'll need to build it yourself which isn't that hard. Keep in mind fpc, the compiler, is separate from Lazarus, but if you want to use Lazarus with fpc 3.1.x you need to build Lazarus using fpc 3.1.x. Again it's not that hard (make all).
The change we're talking about automatically invokes Initialize and Finalize on all types for dynamic allocations / destruction, unless they intentionally circumvent it. Intentional circumvention might include allocating raw memory in a class and treating the class like an array with an index property. In other words, if you declare a raw pointer, allocate untyped memory (e.g. bytes), and handle something back from that memory using a typecast, then you are bypassing automatic allocation and destruction.
All other ways to make space for complex types (records and classes) as well as types which may hold complex types (arrays and nested fields) will safely and reliably use Initialize and Finalize when needed if they are defined.
This post isn't different enough from the previous one to justify a second major thread in the same month. We understand how cool this project is. It's just that frontpage space is scarce on HN and the hivemind is sensitive to repetition.
People come to HN to escape repetition—except of their favorites, of course, which they love to see repeated. Everybody's favorites are different, so for an overall solution we need to regulate repetition.
Project-release threads tend not to be about the incremental features in the new release but rather free-ranging discussion of the project in general. That's fine, but about one per project per year is the right amount for HN to host. That gives us a good mix of projects to discuss while still leaving space for other things.
And to associate a face with the name, here is the screen shot page: http://wiki.lazarus.freepascal.org/Screenshots
W10 Specific page: http://wiki.lazarus.freepascal.org/File:lazarus_win10_1709.p...