3 ms·
> an applications programming language that's both fast, statically typed, and minimalistic While at it, does Zig fit this bill? (Or, haha, Free Pascal / Lazar
by nine_k 1y ago
> an applications programming language that's both fast, statically typed, and minimalistic
While at it, does Zig fit this bill? (Or, haha, Free Pascal / Lazarus, if we talk about desktop software.)
- torginus 1y agoWhile I do like Zig, I would prefer automatic memory management for most application code. My priorities there are spending the least amount of effort and complexity on solving the problem, while ensuring the created code is both bug-free and maintainable, and am willing to give up some performance for that compared to raw C speed. Zig seems to be a step back in that manner, even compared to C++ which at least has unique_ptr/shared_ptr. For Pascal variants, way back when I used to enjoy writing Delphi, I think it was a great language, however I haven't been keeping up with the Pascal world.
- thegeekpirate 1y agoFar too complex, Odin (my favorite language for writing apps in) would align more with minimalistic values. Lazarus always looked good, so there's probably value there if having a GC isn't an issue.
- shakow 1y agoLazarus does not have a GC AFAIK, it's manual-free.
- thegeekpirate 1y agoIt does seem like they somewhat do now, as of the last several years https://wiki.lazarus.freepascal.org/management_operators https://wiki.lazarus.freepascal.org/management_operators From https://news.ycombinator.com/item?id=19100760 https://news.ycombinator.com/item?id=19100760 since I'm not a Pascal user: > 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.