Melbourne Meeting 16 May 2022

Graham Grieve will be presenting on

Writing Code for Delphi and Lazarus

When: 6:00 pm for a 6:15pm start.
Where: At the Melbourne Men’s Shed, and on Zoom.

1 Like

Reminder, it is this coming Monday.

Thanks

1 Like

Melbourne ADUG is inviting you to a scheduled Zoom meeting.

Topic: ADUG Melbourne Meeting
Time: May 16, 2022 06:00 PM Canberra, Melbourne, Sydney

Join Zoom Meeting

Meeting ID: 832 3187 1620
Passcode: 155003
One tap mobile
+61280156011,83231871620#,*155003# Australia
+61370182005,83231871620#,*155003# Australia

Dial by your location
+61 2 8015 6011 Australia
+61 3 7018 2005 Australia
+61 7 3185 3730 Australia
+61 8 6119 3900 Australia
+61 8 7150 1149 Australia
+1 646 558 8656 US (New York)
+1 669 900 9128 US (San Jose)
+1 253 215 8782 US (Tacoma)
+1 301 715 8592 US (Washington DC)
+1 312 626 6799 US (Chicago)
+1 346 248 7799 US (Houston)
Meeting ID: 832 3187 1620
Passcode: 155003
Find your local number: Zoom International Dial-in Numbers - Zoom

Look forward to receiving the link shortly.

A random collection of Notes from the Melbourne Adug May Meeting 16/05/2022

Writing Code for Delphi and Lazarus by Graham Grieve

This was quite an interesting talk and corresponding discussion.

Some bits and pieces, hope it makes some sense :slight_smile:

Has a routine included as first thing in every unit (fhir.inc).

It sets up assorted things based on if Delphi or FPC (and then which
architecture it was compiling for)

All the pascal code is setup for Delphi Mode in FPC.

Mostly the coding is done from a Delphi Programmers view.

There is an an interface unit, that provides replacement routines for
things used in Delphi that are not present in FPC (and a bit of visa
versa)

Iterating strings needs special handling, as strings in FPC are usually
AnsiStrings With UTF8 variable length encoding, where Delphi uses UTF16
(also a variable length) encoding.

There is an iteration routine which handed back a special Unicode
Character type. So it would read the number of bytes necessary for each
Unicode character from the UTF8 string. and (presumably) the 1 or 2
words needed for each Unicode character from the UTF16 string.

Discussed how packages in FPC/Lazarus were different to packages in Delphi.

Benefit of using an object (and descendants) that has a built in reference
count, and has container classes to handle them. So have less need to
keep track of ownership of objects.
(Smart Pointers?, ARC compiler??)

His Gui Programming has migrated completely to Lazarus. As it has cross
platform capabilities, which Delphi is only recently achieving. Main
targets Win64, Linux 64, MacOS 64

Using the trunk versions of FPC and Lazarus, and including some
ModeSwitches to enable beta features.

Update:
Some links
fsl_base.pas
fsl_fpc.pas
fsl_utilities.pas
fhir.inc

Generics a short discussion about how generics in delphi (and Lazarus)
don’t do covariance.

Part of which is. If you make a list, it’s fiddly to use the
list for SomeClassDescendant (Need to cast on putting in, and getting
out)

The articles below have some information on this, and why it’s that way.

https://stackoverflow.com/questions/9140485/delphi-generics-and-polymorphism
http://tech.turbu-rpg.com/149/generics-and-the-covariance-problem
https://web.archive.org/web/20140609/http://blogs.teamb.com/craigstuntz/2009/10/01/38465/

A TestInsight like tool for Lazarus Unit Testing
https://github.com/grahamegrieve/lazarus-ide-tester

Compiler quite a bit slower, but can build packages in parallel using multiple cores.

Building a DevOps toolchain with Delphi, or FPC/FreePascal takes quite a
bit of work. (Malcolm Groves may also have something similar).

Licensing of Delphi in this role at this time is likely dubious.

When a commit to master on Github is attempted. The build system (On the
fly) creates a docker image with a (Microsoft) SQL server as well as My
SQL?, fpc compiler, required pascal packages, etc. and imports and
builds the source, and runs a bunch of unit tests. It also runs a bunch
of checks over the source. If everything is satisfactory, the commit can
proceed.

This creation of docker image with all it’s supporting infrastructure
can occur many times in a day.

One test tests for inclusion of certain unicode characters
that cause text to be skipped/not shown, (so stuff can be hidden from
view in the source, but will be compiled)

Visual Studio Code
WinMerge for reviewing and fixing Conflicts.
Delphi AST

Some Misc Comments

Java
Big and Slow like a Goods Train, but carries a lot, not fun.
Who feels love for a goods train?
(lots of train people? perhaps Java same…)
It will be around a long long time. (Think Cobol).

Delphi/Lazarus
Good for Gui Programs, cf many other options.

C#
Good, WPF released too early.

Thank You Grahame

1 Like

Hi Roger

Was the Melbourne meeting recorded?
Unfortunately I could not make but would love to listen to a recording.

Regards
Graeme

Thanks for the summary @Roger_Plant Roger.

Maybe some DevOps talks would be suitable topics for meetings.

As Graham demonstrated, having automated processing for building and testing makes for more reliability with little extra effort (once the processes are set up).

1 Like

Yes, I am not sure where/how recordings are accessed.
(You could perhaps ask Geoff)

At the meeting I said that we could meet at the Chelsea Hotel on the Nepean Highway to watch the symposium.
I was wrong, :blush:, it is the Chelsea Heights Hotel, on the corner of Springvale Rd and Chelsea Rd. The venue is only a short taxi ride from the Edithvale and Chelsea Stations. More on getting there will be posted on our website.