News for hackers. Stuff that matters.
Re:Lazarus – A Delphi-compatible cross-platform IDE by samuell on Wednesday August 09, 2017 @06:08PM (#14974182)
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)

Re:Lazarus – A Delphi-compatible cross-platform IDE by SXX on Wednesday August 09, 2017 @08:06PM (#14975005)
As 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

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/

PS: Another example would be open source Hedgewars of course.

Re:Lazarus – A Delphi-compatible cross-platform IDE by brass9 on Wednesday August 09, 2017 @11:55PM (#14976199)
> [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.

Re:Lazarus – A Delphi-compatible cross-platform IDE by int_19h on Thursday August 10, 2017 @04:59AM (#14977789)
> Pascal syntax belongs to C family of language.

It can't possibly, seeing how it predates C.

There are specific differences that set them apart, too. For example, the fact that Pascal has statement separators rather than statement terminators (and using a separator in a terminal position is usually an error, e.g. before "else").

Pascal rather belongs to the Algol family of languages, together with C. Algol-60 is where "begin" and "end" come from.

Re:Lazarus – A Delphi-compatible cross-platform IDE by pcblues on Thursday August 10, 2017 @03:41AM (#14977321)
Ex-Delphi developer (10 years) - still do some maintenance...

The verbosity is an indicator that it does not require a huge cliff of learning to understand the syntax. (It also means the compiler can absolutely fly, which Delphi did.)

I like the conciseness of later language structures, but they all need to be learnt in order to read or write in them.

The only solution to the verbosity of Delphi was to increase your typing speed or use an IDE add-in that provided shortcuts :)

So I suppose my argument is that the syntax is not needlessly verbose. The verbosity helped the speed of compilation by the simplicity of its grammar, and the learnability of the language is quite speedy as a result of fewer grammatical options.

Re:Lazarus – A Delphi-compatible cross-platform IDE by epx on Thursday August 10, 2017 @12:45AM (#14976465)
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.

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.

Re:Lazarus – A Delphi-compatible cross-platform IDE by pjmlp on Thursday August 10, 2017 @05:26AM (#14977961)
> Python is being run on microcontrollers these days;

So does Pascal and its descendent Oberon, including FPGAs.

https://www.mikroe.com/mikropascal/

http://www.astrobe.com/default.htm

Natively compiled to machine code, safe, without any help of C.

Re:Lazarus – A Delphi-compatible cross-platform IDE by microcolonel on Thursday August 10, 2017 @12:56AM (#14976542)
> 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. :- )

Re:Lazarus – A Delphi-compatible cross-platform IDE by Jack4E4B on Thursday August 10, 2017 @05:50PM (#14984655)
Just you wait edge computing will move a lot of power to the client... it's coming, especially for AI, cars and any intelligent device.
Re:Lazarus – A Delphi-compatible cross-platform IDE by int_19h on Thursday August 10, 2017 @05:00AM (#14977796)
Wait. Why would a 3D game use Clipper? What for?
Re:Lazarus – A Delphi-compatible cross-platform IDE by microcolonel on Thursday August 10, 2017 @02:54PM (#14982906)
That's what I was wondering, I'm thinking of tracking down whoever added that to the Wikipedia page, because I don't know how they found out.
Re:Lazarus – A Delphi-compatible cross-platform IDE by justin66 on Friday August 11, 2017 @09:38AM (#14989502)
I very strongly suspect that some confused person (or algorithm?) saw that that the level design tool Radiant has a "clipper" and ran with it.
Re:Lazarus – A Delphi-compatible cross-platform IDE by microcolonel on Friday August 11, 2017 @11:13AM (#14990459)
https://en.wikipedia.org/w/index.php?title=Id_Tech_5&diff=pr...

Hard to say, bots usually have usernames, so probably a person.

https://en.wikipedia.org/wiki/Special:Contributions/99.100.1...

They also seem to have added a similar section to the id Tech 6 article, it's possible they're just an insider.

https://en.wikipedia.org/w/index.php?title=2015&diff=prev&ol...

But looking at other edits from this address it sees like they might just be a vandal; or at least somebody who is very confused about how Wikipedia works.

Re:Lazarus – A Delphi-compatible cross-platform IDE by tonyedgecombe on Thursday August 10, 2017 @02:39AM (#14977052)
If someone is working on ERP systems then I don't think the cost is going to be that significant to them.
Re:Lazarus – A Delphi-compatible cross-platform IDE by positivecomment on Thursday August 10, 2017 @08:12AM (#14978830)
> Even C# has a better, readable and concise syntax

C# has amazingly easy-to-read syntax, but maybe I'm biased because I'm most comfortable with C-like syntaxes.

Re:Lazarus – A Delphi-compatible cross-platform IDE by samuell on Thursday August 10, 2017 @06:22AM (#14978233)
One of the main points that makes me happy about Pascal syntax compared to some C-family langs like Java is that types are placed AFTER the variable names, making it much easier to scan the left border of the editor for meaningful info.

Happy that recent languages like Go and Kotlin have learned the lesson and are going the Pascal way again.

Re:Lazarus – A Delphi-compatible cross-platform IDE by krylon on Thursday August 10, 2017 @03:07AM (#14977153)
> there's so much unnecessary visual noise

FWIW, I took over maintenance of an in-house application written in Delpi/ObjectPascal, with practically no prior experience with Pascal (but one fun weekend looking at Ada), and I had almost no problems reading the code that were caused by Pascal's syntax. It might be because the guy initially wrote the application did a good job, but I found the code very easy to read.

Re:Lazarus – A Delphi-compatible cross-platform IDE by geff82 on Thursday August 10, 2017 @03:46AM (#14977345)
[x] Easy string handling (compared to C)

I like how you say python-like syntax... as so many borrow from Pascal

Re:Lazarus – A Delphi-compatible cross-platform IDE by adrianlmm on Wednesday August 09, 2017 @10:18PM (#14975767)
I'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.
Re:Lazarus – A Delphi-compatible cross-platform IDE by samuell on Thursday August 10, 2017 @06:24AM (#14978246)
If 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 :)
Re:Lazarus – A Delphi-compatible cross-platform IDE by HelloNurse on Thursday August 10, 2017 @01:11PM (#14981824)
Electron is degenerate, not "modern". XUL was modern.
Re:Lazarus – A Delphi-compatible cross-platform IDE by DisownedWheat on Wednesday August 09, 2017 @10:47PM (#14975899)
Depends 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.
Re:Lazarus – A Delphi-compatible cross-platform IDE by gardnr on Thursday August 10, 2017 @01:34AM (#14976739)
Back in the day I used to run the exe through and get them even smaller: https://upx.github.io/
Re:Lazarus – A Delphi-compatible cross-platform IDE by badsectoracula on Thursday August 10, 2017 @07:41AM (#14978669)
UPX is misleading though since it needs more memory than the EXE itself.
Re:Lazarus – A Delphi-compatible cross-platform IDE by tigershark on Wednesday August 09, 2017 @11:27PM (#14976079)
No 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.
Re:Lazarus – A Delphi-compatible cross-platform IDE by klipt on Thursday August 10, 2017 @12:47AM (#14976477)
Lazarus is Object Orientated. Delphi definitely offers garbage collection in newer versions, not sure about Lazarus.
Re:Lazarus – A Delphi-compatible cross-platform IDE by undreren on Thursday August 10, 2017 @01:43AM (#14976790)
No. 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.
Re:Lazarus – A Delphi-compatible cross-platform IDE by pjmlp on Thursday August 10, 2017 @05:30AM (#14977977)
For those lacking CS background, reference counting is an GC algorithm.

The 5th chapter from "The Garbage Collection Handbook", http://gchandbook.org/, one of the most renowned books in the field, there are of course other equally renowned sources I can refer to.

Re:Lazarus – A Delphi-compatible cross-platform IDE by zerr on Thursday August 10, 2017 @07:03AM (#14978449)
Formality aside, it's about deterministic GC vs nondeterministic GC.
Re:Lazarus – A Delphi-compatible cross-platform IDE by pjmlp on Thursday August 10, 2017 @07:25AM (#14978560)
Reference counting isn't deterministic in the presence of large complex data structures.

You will know when memory gets deleted, but not how long it will take, nor how much stack space the destructors will require to run.

Enjoy Herb Sutter's "Leak-Freedom in C++... By Default." at CppCon 2016, where he explains how those issues affect C++ and goes on to implement a tracing GC.

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

Re:Lazarus – A Delphi-compatible cross-platform IDE by TimJYoung on Friday August 11, 2017 @02:51PM (#14992998)
You would never code the SomeMethod like that, you would use this instead:

    var
        LObj: IMyInterface;
    begin
        LObj := TMyClass.Create;
        DoTheFoo(LObj);
        LObj.Foo;
    end;
Re:Lazarus – A Delphi-compatible cross-platform IDE by klipt on Thursday August 10, 2017 @02:05AM (#14976894)
Oh, 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...

Re:Lazarus – A Delphi-compatible cross-platform IDE by undreren on Thursday August 10, 2017 @02:54AM (#14977105)
I actually feel that shared_ptr is a better fix, because that makes the memory handling consistently opt-in, instead of inconsistent.
Re:Lazarus – A Delphi-compatible cross-platform IDE by MageSlayer on Thursday August 10, 2017 @05:19AM (#14977920)
I highly doubt it's production code. Nobody uses both objects(pointers) and interfaces simultaneously. It's a quick way to disaster. In practice Delphi/FPC interfaces serve their purpose.
Re:Lazarus – A Delphi-compatible cross-platform IDE by Jack4E4B on Thursday August 10, 2017 @05:52PM (#14984670)
Swift also does Reference counting, the difference is huge. Speed of code is in another level. I am new to Lazarus, but I am guessing they do the same as Delphi.
Re:Lazarus – A Delphi-compatible cross-platform IDE by mmargerum on Thursday August 10, 2017 @09:57AM (#14979674)
I 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.
Re:Lazarus – A Delphi-compatible cross-platform IDE by generic_user on Wednesday August 09, 2017 @07:19PM (#14974675)
do you know what UI kit is used on Linux?
Re:Lazarus – A Delphi-compatible cross-platform IDE by SXX on Wednesday August 09, 2017 @07:25PM (#14974721)
There are options for both GTK and Qt.
Re:Lazarus – A Delphi-compatible cross-platform IDE by generic_user on Wednesday August 09, 2017 @07:52PM (#14974904)
Very nice, I will take a look.