3 ms·
this is a question for those using freepascal, how would you compare it to modern languages like scala, go, rust
by systems 10y ago
this is a question for those using freepascal, how would you compare it to modern languages like scala, go, rust
- noir_lord 10y agoFree Pascal implements Object Pascal. Not used it in a while but I was a Delphi programmer years ago. Object Pascal is a decent language, it implements most of the OO features you'd expect in a 'modern' language. It has very nice data type support via records, nice out the box string support, it supports properties with optional read/write specifiers (really useful). The usual stuff in terms of interfaces and generics. It's unit system is clean, clear and unambiguous. Moving away from the language it's compiler is very fast as is the output, it's generally in the same order of magnitude as C++ or Java (https://benchmarksgame.alioth.debian.org/u64q/pascal.html https://benchmarksgame.alioth.debian.org/u64q/pascal.html the always unreliable in the realworld benchmarks).
- systems 10y agoanother question please i believe cross compilation (ability to compile to many platforms from one source code, from one dev machine and target many other platforms) and the ability to easily mix assembly with code are touted as some of freepascal/lazarus special features/edges, is this correct, or is this not very special or particularly powerfull in freepascal/lazarus
- ALB42 10y agoEspecially powerful is the LCL (Lazarus component library) a GUI wrapper library which makes it possible to "write once compile everywhere" (Slogan of Lazarus). An in difference to QT or gtk and such toolskits it looks native on every platform because in the backend LCL can use GTK, GTK2, QT, Win-API or in this case MUI to create the GUI, so the application look not like aliens but native.
- narag 10y agoLast time I asked, cross compilation is not easy feat. No problem compiling the same source for different targets, but from the same machine? There's no easy way, specially for Macs. Mind you it's not impossible, but it's not the recommended path. Assembly you can insert it directly in code. To reconcile that with the prior question, use ifdefs. Edit: the reason they gave me is that the linker (IIRC, GNU tools) needs the target DLLs to work properly. A good solution would be using a Mac as development machine with VMs for the rest of targets.
- noir_lord 10y agoNot sure they are special features as other languages have them but Free Pascal does have excellent cross-platform support and yes using assembly inline is pretty nice. Also the LCL is great in that they implement it for a lot of the platforms they support so you can do RAD on Windows and (fairly) easily get the same program running on Linux and vice versa.
- kingmanaz 10y agoOne of the more productive programmers I'd come across primarily used Pascal and PowerBuilder. He was a one-man dynamo. As to the Pascal language itself: You may want to look into Ada as it shares more than a little in common and can be compiled with gcc. Try it yourself and see what you think.
- nickpsecurity 10y agoOn top of nordlord comment, Ill add Go and Free Pascal are both decendents of Wirth style of languages. So, the benefits like fast compilation, easy analysis, safer by default, and decent output are shared. Pascal, on other hand, can go down to the metal for writing OS's and embedded apps.
- Lerc 10y agoHere's a piece I wrote to give people an overview. http://screamingduck.com/Article.php?ArticleID=43&Show=ABCE http://screamingduck.com/Article.php?ArticleID=43&Show=ABCE I don't really use FreePascal much anymore. I would seriously consider it again if someone developed a branch breaking backward compatibility. I feel like it need a signficant decluttering to get rid of legacy implementations taking all the good names. For example freepascal has TList: Manages a list of pointers, can search and sort the list, has event notification feature TFPList: Manages a list of pointers, can search and sort the list, without event notification feature, faster than TList TFPGList: generic supporting list. TObjectList TFPObjectList TFPGObjectList The FP part of the prefix indicates a FreePascal class. The simplest names TList and TObjectList are descended from Deplhi and hold that space for compatibility. Generics came later in the language development so needed to take third pick of name. The Standard Libraries of FreePascal are nicely consistent in naming at least. You don't have to hunt for the right name. It still feels cluttered though