7 ms·
Lazarus/FPC checks so many nice boxes: [x] Statically compiled [x] Native UI on Linux/Mac/Win [x] Typically compiled without code changes on Linux/Mac/Win [
by samuell 9y ago
Lazarus/FPC checks so many nice boxes:
[x] Statically compiled
[x] Native UI on Linux/Mac/Win
[x] Typically compiled without code changes on Linux/Mac/Win
[x] Small binaries
[x] No GC
[x] Readable, somewhat python-like syntax
[x] Still, doesn't rely on indentation for nested blocks
[ ] (Fill in)
- generic_user 9y agodo you know what UI kit is used on Linux?
- SXX 9y agoThere are options for both GTK and Qt.
- generic_user 9y agoVery nice, I will take a look.
- deleted 9y ago[deleted]
- SXX 9y agoAs soon as you need 3rd-party libraries "statically compiled" is no longer the case. Or at least it's not easy, depend on platform and still bring a lot of mess. Though in the right hands Lazarus is a great tool since relatively complex project could be completed just by one developer. E.g here is our game engine map editor: https://github.com/vcmi/vcmi_editor https://github.com/vcmi/vcmi_editor Another thing to note is that FPC provide good performance and even used for game development and memory footprint is small. There is RTS on Steam called Cossacks 3 and it's fully in Pascal (though no idea if they using FPC outside of Linux): http://store.steampowered.com/app/333420/Cossacks_3/ http://store.steampowered.com/app/333420/Cossacks_3/ PS: Another example would be open source Hedgewars of course.
- adrianlmm 9y agoI've created small projects in Lazarus and you are right in all points except in the small binary part, also I would add that it comes with db drivers for Postgrees, MySQL and Firebird SQL out of the box.
- DisownedWheat 9y agoDepends on what you define as small but if you remove the GDB debugging information you can trim down your binaries by a huge amount. My last project was 3.4MB.
- gardnr 9y agoBack in the day I used to run the exe through and get them even smaller: https://upx.github.io/ https://upx.github.io/
- badsectoracula 9y agoUPX is misleading though since it needs more memory than the EXE itself.
- samuell 9y agoIf you compare to the "modern" way of building cross-platform apps: Electron ... with its 100s of MBs, I'm definitely regarding Lazarus binaries as small :)
- HelloNurse 9y agoElectron is degenerate, not "modern". XUL was modern.
- tigershark 9y agoNo GC is actually an advantage? The world really changed, there are people rejoicing for procedural languages, while we have so many excellent OO and FP alternatives, and they are actually happy to shoot their own foot with manual memory management. I'm not really sure that the change has been for the better.
- klipt 9y agoLazarus is Object Orientated. Delphi definitely offers garbage collection in newer versions, not sure about Lazarus.
- undreren 9y agoNo. Delphi offers reference counting, but only on interface variables. It's a huge difference really, because if your last interface variable that points to an object goes out of scope, the object is freed from memory. Even if you have raw class pointers to it. Example: IMyInterface = interface procedure Foo; end; TMyClass = class(TInterfacedObject, IMyInterface) procedure Foo; end; procedure TMyClass.Foo; begin WriteLn('Foo'); end; procedure DoTheFoo(AObj: IMyInterface); begin AObj.Foo; end; procedure SomeMethod; var LObj: TMyClass; begin LObj := TMyClass.Create; DoTheFoo(LObj); LObj.Foo; // <-- Will cast nil pointer exception, // as object was freed when AObj in DoTheFoo went // out of scope end; I work with Delphi in my day job.
- klipt 9y agoOh, in that case that's no better than C++'s shared_ptr. I remember Delphi being fun back in the day and it still compiles way faster than C++, but C++ is evolving and maybe with modules even the compilation speed gap will disappear...
- undreren 9y agoI actually feel that shared_ptr is a better fix, because that makes the memory handling consistently opt-in, instead of inconsistent.
- brass9 9y ago> [x] Readable, somewhat python-like syntax I have a rather different opinion on OP that it has a needlessly verbose syntax. Pythonic it is definitely not. Even C# (which is another creation of Anders Hejlsberg, after MS poached him from Borland) has a better, readable and concise syntax. I used to be a Delphi evangelist in it's glory days. Now I bristle when I read Pascal source code, there's so much unnecessary visual noise. Of course if your brain is habituated enough to parse Pascal code, eventually you will tend to filter out the begin..end's. Pascal syntax belongs to C family of language. As regards to Python-like syntax, I think you are referring to the Nim language, whose syntax happens to be similar to that of Pascal.
- epx 9y agoMy feeling as well. In my heart I am really happy that Lazarus (and Harbour, the Clipper-compatible compiler) exist, but being rational the days of desktop applications are over. Python is being run on microcontrollers these days; I actually wrestle with the non-adoption of Python (or Ruby, or Javascript, or Tcl) as 1st-class citizen language for desktop and mobile; it does not make sense for me. Certainly writing desktop/web apps in C++ or Pascal make even less sense. Perhaps I am forgetting the big number of fellow developers that work on ERP systems and outdated software, for them it is a blessing to have free tools, while in the 90s such a tool could cost $3k.
- microcolonel 9y ago> My feeling as well. In my heart I am really happy that Lazarus (and Harbour, the Clipper-compatible compiler) exist, but being rational the days of desktop applications are over. Oh boy, I hadn't heard about Harbour until now; earlier today I was looking at the Wikipedia page for id Tech 5, and it says it uses Clipper so I was really scratching my head wondering how they pulled that off and why. Now I know, thanks for mentioning it. :- )
- int_19h 9y agoWait. Why would a 3D game use Clipper? What for?
- geff82 9y ago[x] Easy string handling (compared to C) I like how you say python-like syntax... as so many borrow from Pascal
- mmargerum 9y agoI would love to switch off Delphi, but I'm heavily dependent on spring4d which is Delphi only right now. I may build some smaller programs or utilities in Lazarus.