News for hackers. Stuff that matters.
Re:Things That Turbo Pascal Is Smaller Than (2011) by themodelplumber on Saturday April 11, 2020 @05:12PM (#22844293)
Yes! I use it and really enjoy it so far. There are obviously some people using it for _very_ advanced work in medicine and the sciences, to see some of the community posts and shared libraries... Personally I think I'm building yet another text editor (starting with a text viewer) but the experience has been great.

The community is really a nice bonus, too.

Re:Things That Turbo Pascal Is Smaller Than (2011) by brnt on Saturday April 11, 2020 @05:31PM (#22844413)
Where does that community hang out? I find it very difficult to find Pascal projects on Github for instance.
Re:Things That Turbo Pascal Is Smaller Than (2011) by superdisk on Saturday April 11, 2020 @11:49PM (#22845930)
Definitely the Lazarus Forum as others have noted. In my opinion, it's a really delightful time capsule of how internet communities used to be before Facebook/Reddit. Insanely helpful and knowledgeable members that will answer any question, a bunch of eccentric characters, plenty of n00bs asking mundane questions, and the compiler developers themselves. Probably my favorite language ecosystem.

https://forum.lazarus.freepascal.org/index.php

Re:Things That Turbo Pascal Is Smaller Than (2011) by brnt on Sunday April 12, 2020 @03:42AM (#22846635)
That's the only resource I could find too, but few linked repos of complete or modern projects, or am I missing something?

Github has some repos but mostly dumps of old Delphi projects, not really a great resource.

Re:Things That Turbo Pascal Is Smaller Than (2011) by FpUser on Saturday April 11, 2020 @06:47PM (#22844789)
All you have to do is enter delphi in search box of github and you get whole pile of projects. Alternatively you can enter pascal instead of delphi. this agail will get you pile of projects albeit smaller. If that is difficult I am not sure what easy is.
Re:Things That Turbo Pascal Is Smaller Than (2011) by nick_meister on Sunday April 12, 2020 @08:54AM (#22847932)
I agree with brnt, while Delphi/Object Pascal seem to be quite popular according to the Tiobe Index, https://www.tiobe.com/tiobe-index/delphi-object-pascal/, I find it hard to find open-source projects when comparing it with other programming langs. Example:

  https://github.com/search?q=Rust 85,885 repository results  
 
  https://github.com/search?q=delphi 9,938  

  https://github.com/search?q=pascal 9,259
Maybe:

* Open source Delphi/Pascal are shared elsewhere?

* Delphi Programmers do not like to showcase or open-source their projects?

* Delphi/Pascal is used to create mainly proprietary software?

Either way, I think that for Free Pascal to prosper in the long term, something should change. Perhaps more open source projects published on Github/Gitlab.

Re:Things That Turbo Pascal Is Smaller Than (2011) by FpUser on Sunday April 12, 2020 @04:10PM (#22850703)
FreePascal/Delphi are used by large number of developers. I do not think there is a need for them to prosper in a sense of high Tiobe index. There are way more obscure languages some pretty big companies are using for their internal stuff without much ado about popularity.

You are confusing "hard to find" with "less". There is way less projects on github (the original question specifically mentioned github). However 9,000 is still a big number and one can find virtually anything needed from a practical standpoint. On top of that both delphi and lazarus come with huge system libraries.

C++ for example dwarfs delphi on github. However when I am doing C++ I am looking for very few projects in very specific areas (network, file management, db connectivity etc). Suddenly your choice becomes not that big when you separate all the noise.

Also whole bunch of delphi projects are located elsewhere due to various reasons. Hence my advice to ask Google.

Finally delphi projects tend to be rather large and high quality, check this one for example: https://github.com/BeRo1985/pasvulkan or other repos from the same guy.

Re:Things That Turbo Pascal Is Smaller Than (2011) by benibela on Monday April 13, 2020 @10:12AM (#22855968)
It is elsewhere:

    https://sourceforge.net/directory/?q=rust              27    programs

    https://sourceforge.net/directory/?q=pascal            2268
Re:Things That Turbo Pascal Is Smaller Than (2011) by brnt on Saturday April 11, 2020 @07:20PM (#22844941)
Its a very small set you find that way...
Re:Things That Turbo Pascal Is Smaller Than (2011) by FpUser on Saturday April 11, 2020 @07:27PM (#22844976)
shows 6000 entries for me. there is also that thing called google.
Re:Things That Turbo Pascal Is Smaller Than (2011) by brnt on Sunday April 12, 2020 @02:03AM (#22846352)
Im beginning to see that welcoming community I think!
Re:Things That Turbo Pascal Is Smaller Than (2011) by FpUser on Sunday April 12, 2020 @07:10AM (#22847413)
Even though I was using Turbo Pascal/Delphi/Lazarus since 80's I am not really part of community. I do not think you'll find a single post of mine. So do not take me as an example.

I have to admit being a prick in this particular matter. Not being able to find subject when search on Google, Githab etc reveals a ton of info I think says something.

One extra thing. I do use Linux and find it very useful. Do I need to abandon it because Linus is not a shining example of polite person?

Re:Things That Turbo Pascal Is Smaller Than (2011) by brnt on Sunday April 12, 2020 @09:45AM (#22848205)
I think on here you can safely assume I have tried to Google, and do a codesearch on Github. Like another poster shows, certianly comparatively, you won't find much. That which I did find is nearly always Delphi (which does not translate to Freepascal, the only platform that would be interesting now I'd say). Very few complete and modern(-ish) repo's, rather than someone throwing their 15 year old Delphi project online.

I've done some Pascal coding, and this lack of libraries or projects is for me a practical impediment. Freepascal (and Delphi) come with very complete stdlibs (if they are called that), but I'd not be satisfied with merely Python's stdlib either. On top of that, string handling is imho very uncomfortable in Pascal, feels like nothing changed much in 20 years. I found a recent Freepascal university course, but source files with 10kLoC do not make it helpful to get started.

So, while the Freepascal forums seem helpful, it's a meager resource if that's basically all the community is.

Re:Things That Turbo Pascal Is Smaller Than (2011) by themodelplumber on Saturday April 11, 2020 @06:55PM (#22844829)
Last week I saw that kind of content on freshcode.club as well as at least one of the Facebook groups.
Re:Things That Turbo Pascal Is Smaller Than (2011) by analognoise on Saturday April 11, 2020 @09:35PM (#22845472)
The Lazarus forums! They're great; wonderful community of people who are really great.
Re:Things That Turbo Pascal Is Smaller Than (2011) by unnouinceput on Saturday April 11, 2020 @06:26PM (#22844697)
I don't. Whoever thought recompiling Lazarus whenever you need to simply add another component to its pallet really lost the spirit of Pascal/Delphi on that one.
Re:Things That Turbo Pascal Is Smaller Than (2011) by badsectoracula on Sunday April 12, 2020 @08:10AM (#22847692)
It was done because of technical limitations - the compiler didn't support dynamic packages (collections of dynamic libraries). This was again due to technical limitations from the compiler having to work in multiple OSes (i'm not 100% sure on the detail) and how they share and export symbols from dynamic libraries, something that Delphi didn't have to since it only had to work with Windows and only with their own libraries. FPC and Lazarus are also technically separate projects with their own release schedules and Lazarus has to work with multiple versions of FPC that make things a bit harder. This made introducing dynamic packages very hard... and since there wasn't much of a benefit for most uses (recompiling Lazarus is almost instant after the first compile and even that takes less than a minute even on old hardware), it wasn't something that FPC developers focused on much.

Having said that, the next version of FPC will support dynamic packages. They had to change some things in how RTTI is stored, apparently, to accommodate the OS differences (this may break some programs that use the RTTI structures directly, though the fix is trivial and 99.999% of programs wont be affected - even some of my own code that does touch RTTI directly works fine in both the latest stable version and the development version).

However chances are Lazarus will still keep using the recompile approach for some time since it'll need to work with FPC 3.0.x... and also it will take some time to update all packages to work dynamically.

Anyway, what i'm trying to say, this was done due to technical issues and compiler limitations due to what FPC and Lazarus have to support and remained an issue for a long time because in practice it didn't make much of a difference. However it will soon be solved.

Re:Things That Turbo Pascal Is Smaller Than (2011) by unnouinceput on Sunday April 12, 2020 @02:16PM (#22850017)
" Delphi didn't have to since it only had to work with Windows and only with their own libraries"

Delphi has for some years the possibility to work on more then just Windows, and still is a breeze, regardless if I targeting Android or Windows, to just "here is the package, put the component on palette" with just 2 clicks.

I really hope Lazarus will come home, like you say, with this, since Delphi is not targeting ARM in Linux, while Lazarus does. We'll see what future holds, as I have no problem using one or the other as long as the compiled project works on its intended target. Also regarding RPI, I can just install Android on RPI4 and Delphi will have no problem targeting that

Re:Things That Turbo Pascal Is Smaller Than (2011) by badsectoracula on Sunday April 12, 2020 @02:32PM (#22850123)
AFAIK Delphi on non-Windows is very different than Delphi on Windows, exactly because of issues (and AFAIK it even used FPC for a little for non-Windows targets, though this was eventually replaced with their own code when they started using LLVM). They were perfectly fine with having differences between platforms at the core level, however this wasn't what FPC developers or Lazarus developers wanted - in general they try to have things operate as similar to all OSes as possible and they also support way more targets than Delphi, which complicates things.

In any case i was referring to Delphi in general from the start. Delphi had support for dynamic packages since version 1, but for decades they only supported Windows. FPC on the other hand had support for multiple OSes before even version 1.0 was released.

TBH i do not remember the exact details, but IIRC it had to do with memory management, symbol resolution and RTTI support across DLLs (e.g. being able to do something like "Foo is BarClass" in DLL A, Foo is an object instantiated in DLL B with a class that is only available on that DLL B but descends from a class defined in the main program whereas BarClass is a variable holding a virtual class defined in DLL C that also descends from the same class - essentially tying to merge in RTTIs from different AOT compiled modules where none has a complete view).

And of course the fact that it was a low priority issue since there wasn't any major practical drawback (personally the only issue i had was that i couldn't share the RTL and LCL between executables that i'd otherwise package together, meaning that the produced executables would take more disk space than necessary since each executable is having their own copy of the RTL and LCL instead of using them from a shared object/DLL).

Re:Things That Turbo Pascal Is Smaller Than (2011) by unnouinceput on Sunday April 12, 2020 @08:58PM (#22852204)
Yeah, Delphi is still trying to find its compass when dealing with cross-platform. Intentions are good, just execution lacks. Problem is currently none of them (either Delphi nor Lazarus/FPC) are a good fit overall. Each solves problems on different platforms differently while having other problems that are non-existing for the other.

I do have fun playing with them though, trying to learn each what quirks lurks around. I mean one example is above I said - Delphi can target ARM if it's Android, but can't target ARM if it's Debian. So I can run on RPI something Delphi cooked if I have Android there, but if I have Raspbian I can't. Same hardware, different OS, such a hard nut to crack :). While if it's Intel and you have Linux, guess what - Delphi owns it.

So for now I am switching between IDE's/Frameworks all depending on availability of technology and most importantly what client(s) want.

Re:Things That Turbo Pascal Is Smaller Than (2011) by themodelplumber on Saturday April 11, 2020 @06:57PM (#22844840)
Interesting. I haven't needed to do so, but I thought I had heard that was a pretty quick recompile, on the order of < 10 seconds? I know there are some tips to speed it up.

Here's the wiki page on component authoring:

https://wiki.freepascal.org/How_To_Write_Lazarus_Component

Re:Things That Turbo Pascal Is Smaller Than (2011) by unnouinceput on Sunday April 12, 2020 @07:27AM (#22847513)
Except when you need to, it's not working, or creepy bugs won't let you do it. Do try it on Lazarus for Raspberry Pi for example (you can do it on a virtual machine if you lack the real device). You'll see what I mean.
Re:Things That Turbo Pascal Is Smaller Than (2011) by badsectoracula on Sunday April 12, 2020 @08:12AM (#22847703)
Are you using the official releases? If you are using Lazarus from Debian or some other repository, it will not work due to these packages not setting up permissions for the executable to be replaced.

In general IME on Linux the best approach is to install FPC (either from repositories or, better, using the official release) and then download the Lazarus source code and compile it somewhere in your home directory with 'make bigide'. This will avoid any problems with Lazarus packaging that often tends to be broken (again, IME).

Re:Things That Turbo Pascal Is Smaller Than (2011) by unnouinceput on Sunday April 12, 2020 @02:13PM (#22849994)
I used in home instead in it's official release. Also I sudo-it when launch it, so it will have full rights. On some packages it didn't work, no matter what I did. I had to use official apt from repositories for those packages (lucky me they had that).
Re:Things That Turbo Pascal Is Smaller Than (2011) by badsectoracula on Sunday April 12, 2020 @02:35PM (#22850144)
Hm if you installed the program from the sources it should work, though you may also need to install the development packages for Gtk, etc.

You can see the whole process in this video i took a couple of years ago:

https://www.youtube.com/watch?v=s_01Xhd2EJM

(this is making a simple puzzle game)

I'm basically doing the same procedure for many years now and i never had an issue with getting Lazarus or any of its packages to work.