News for hackers. Stuff that matters.
Re:Lazarus – Professional Free Pascal Rad IDE by tomc1985 on Saturday April 23, 2022 @01:55AM (#31131783)
So glad to see this on the front page!

I'm no expert, and Pascal is kind of a weird language by modern standards, but Lazarus does cross-platform desktop development using GTK or QT bindings.

Electron Devs Hate This App!

(ok, maybe not really, but I wish they did!)

PeaZip is written in Lazarus (check out https://forum.lazarus.freepascal.org/index.php?topic=52417.0), and I've seen a few other odds and ends around the net mention the IDE in passing.

Personally I like that it gets and stays out of my way. The UI design copies Visual Basic almost to a T and is a little dated by today's standards, but all the important bits are there.

Re:Lazarus – Professional Free Pascal Rad IDE by andrewshadura on Saturday April 23, 2022 @03:26AM (#31132178)
If it copies anything, it’s first of all Delphi, around the version 7 :)
Re:Lazarus – Professional Free Pascal Rad IDE by nobleach on Saturday April 23, 2022 @10:42AM (#31134681)
And 7 was just "let's try and add some 'web' to Delphi 6". And 6 was "Hey, Kylix is gonna be huge on Linux, so let's try and align Delphi 5"...

Still one of my favorite programming experiences in my life.

Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @11:57AM (#31135414)
It is way, way more than Delphi 7.

I've managed to easily port good sized modern Delphi project to run on Raspberry Pi using Lazarus.

Re:Lazarus – Professional Free Pascal Rad IDE by tomc1985 on Saturday April 23, 2022 @11:34AM (#31135141)
Having never used Delphi, the parallels to VB were uncanny. So I guess Delphi copied VB
Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @11:56AM (#31135396)
LOL. Delphi ran circle around VB. It could do what VB did but way better and could also do what MS C++ did. Obviously as you admit you have no real knowledge of the subject.
Re:Lazarus – Professional Free Pascal Rad IDE by tomc1985 on Saturday April 23, 2022 @12:07PM (#31135517)
Wow, could you be any more haughty? I'm referring specifically to the UI. Yes I never worked with Delphi so I am indeed quite ignorant to its obviously apparent wonder.
Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @03:24PM (#31137542)
Delphi's precursors were Pascal as a language and ObjectVision as the concept of the UI (released in 1991). Both products created by Borland. It did not need VB to "copy from". Borland tools of the time were superior to MS and drove Gates nuts.
Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @11:52AM (#31135344)
>"Pascal is kind of a weird language"

Pascal in Delphi / Lazarus in its current form is a full featured language that implements large amount of common concepts expected from a modern language. I do not see anything weird in it.

Re:Lazarus – Professional Free Pascal Rad IDE by benibela on Saturday April 23, 2022 @04:11PM (#31138037)
All of it is weird

They always implement some language feature, but then put some weird, arbitrary restriction on it. It is twice as weird in FreePascal, because the developers cannot decide if they want to make their own language or be Delphi compatible.

Some weirdness examples:

There is automated reference counting to get memory safety, but only for strings and arrays (and also interfaces but we get to that later)

There is mutability xor aliasing, but only for strings

There is a type to store sets of integers, but you cannot have more than 256 elements

There is a type to store a slice of an array, but it can only be used during function calls, so no one ever uses it. Also it looks like it cannot be used with a slice of length 0, unless it is a slice of an array of length 0.

Interfaces are a very common concept in OOP languages. They specify some methods, but not their implementation. Everyone here knows how they work and in Pascal they work in the same way. Except, in Pascal they are also COM interfaces and add automated reference counting to a class. It is weird in the reverse, too. You can have classes with ARC which are almost memory safe, but only if you use an interface.

Array indices start with 0, string indices start with 1. It is already weird, but you can get used to it. But now they added OOP like string functions and it became weirder. Copy(Str, ...) becomes Str.Copy(..). And all the new methods use 0-based indices for strings.

Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @05:56PM (#31139014)
Every language has various peculiarities / weirdness, tons of it actually. If you use multiple languages you just get used to this. That is my case and I do not consider it weird. If you stick to 1 or 2 languages than sure - everything else seems weird.

>"they added OOP like string functions" - not sure / forgot what is official name for it but it is not unique to pascal.

Again we have totally different perspective on weirdness.

Re:Lazarus – Professional Free Pascal Rad IDE by tomc1985 on Saturday April 23, 2022 @01:42PM (#31136421)
My career took me to C-like languages and scripting environments like Ruby or Python. And (love it or hate it) most of the world thinks in JS nowadays. Some aspects of Pascal are really strange or awkward to me, like the rules for whether or not a statement in an `if` block needs to be surrounded by `begin`/`end`, or where the semicolons go in a particularly complicated, nested instance of said `if`.

But I am not a master Pascal programmer by any means. You sound like an expert.

Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @03:32PM (#31137635)
>"most of the world thinks in JS nowadays"

I think in terms of fair amount of languages (including JS) so I do not get hung up on any particular one. My business is product development from scratch. I do it for clients or my own company. Because of that I could not care less about what "most of the world" prefers. I use what I think is most suitable given constraints for each particular project.

Re:Lazarus – Professional Free Pascal Rad IDE by Qem on Saturday April 23, 2022 @02:53PM (#31137191)
Oddly I can't remember any wirthian scripting language, like Ruby or Python. Was Wirth biased against dynamic languages?
Re:Lazarus – Professional Free Pascal Rad IDE by webmobdev on Sunday April 24, 2022 @07:33PM (#31149268)
I don't think so - his focus was always on making compilation fast and the language simpler and easier. See Oberon (the latest language he created) - it's probably even simpler than Ruby or Python.
Re:Lazarus – Professional Free Pascal Rad IDE by twangist on Saturday April 23, 2022 @03:45PM (#31137764)
Pascal might not be weird but it is unpleasant. It has many inconveniences to offer the modern programmer. In its day, in comparison to C -- by programmers for programmers -- Pascal was derided by one computer scientist as "a police-state language" for its many strictures and missing affordances.
Re:Lazarus – Professional Free Pascal Rad IDE by timbit42 on Sunday April 24, 2022 @01:25PM (#31146144)
Pascal is designed to be safe, like Rust is. Pascal was missing some things needed for systems programming but those were added in Pascal's sequel, Modula-2, whose sequel, Oberon, ended up being a very nice language.

It's too bad Modula-2 didn't come along earlier to compete with C. We could have avoided most of the security problems with C and C++ programs.

Instead, here we are, 50 years later, finally moving toward safe languages again. Took long enough.

Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Saturday April 23, 2022 @06:02PM (#31139058)
Some people loved it, some hated it. Some (this includes me) used it where it did offer advantage. I do not use Pascal to write servers (even though I could and did for some particular situations). I use maily C++ for it. But for developing lean and mean desktop GUI apps for multiple platform I find nothing better. Also I am not sure what pascal are you talking about. The one "derided by comp scientists" and current Delphi/FreePascal are one universe apart.
Re:Lazarus – Professional Free Pascal Rad IDE by davidhbolton on Sunday April 24, 2022 @09:36AM (#31143851)
Confession. Learnt Pascal at Uni. Programmed in Compas Pascal 1984 (precursor to Turbo Pascal) then Turbo Pascal 3.0 from 1986-1993. Then from 1997 to the present day worked with Delphi (2,3,4,5,7, XE7 and XE 10.1). I wrote a 40,000 line Postal Game in 1989-1990 in TP 5.0 that still runs today.

Original Pascal was dire at anything except learning Pascal. Strings were type alfa- 10 character strings. Turbo Pascal was the first decent implementation and whipped the pants off its rival UCSD-Pascal. Delphi has been dead though since about 2000 but there's a lot of legacy code around and I'm one of a team of four that look after (maintain and enhance) a 1.35 million Lines of code property management application. A business laptop from 2020 can compile all 1.35 millions lines in around 11 seconds.

Unless you were an ace C++ Windows developer, Delphi was the next best programming language for using the Win32 API and doing low level COM stuff.

Re:Lazarus – Professional Free Pascal Rad IDE by FpUser on Sunday April 24, 2022 @11:54AM (#31145248)
>"Delphi has been dead though since about 2000"

It is and it is not. It is used in many industrial companies for example to write windows based desktop applications. I have couple of my own Windows based products that bring some money. Even though those are about 10 years old I keep them up to date with all new technologies that make sense and port to every new version of Delphi. This is actually very easy and does not require much time. There is also more than enough libraries and components to do just about anything. FFS I do interrupt based device control with the rate of 256 requests / s over USB.

Still for servers / NO GUI I very much prefer C++.

Re:Lazarus – Professional Free Pascal Rad IDE by istoica on Saturday April 23, 2022 @02:17PM (#31136809)
Highly invested in Electron, but I love Lazarus. I find it unmatched in what means developing cross-platform native apps, I only wish more people would know about it and use it, popularize, make noise, contribute.

The maintainers are absolutely awesome guys, the helpful and kind type.

Re:Lazarus – Professional Free Pascal Rad IDE by webmobdev on Sunday April 24, 2022 @07:27PM (#31149232)
> Lazarus does cross-platform desktop development using GTK or QT bindings

Not just GTK (mostly for Linux) or QT (for any) but Win32 (for Windows) and Carbon / Cocoa (for macOS) - so it can produce native GUI. This means smaller codebase and much better user experience.