ADUG Melbourne February Meeting

Hi Everyone,

The Melbourne ADUG February meeting is Tomorrow Night (Monday 21st)
This meeting is going to be both at the Men’s Shed, and on Zoom.

Opening around 6:00pm for a 6:15 start.

We will start with a brief “Public Soap Box” where attendees can ask questions, share discoveries or talk about code.

The zoom details will be be provided shortly before the meeting.

Robert Horbury Smith will be giving a presentation on Elevate Web Builder.
and
John McDonald will be giving a presentation on Functional Programming with Object Pascal.

Thanks
Regards
Roger

Join Melbourne ADUG February Zoom Meeting

Meeting ID: 883 1945 8829
Passcode: 000748
One tap mobile
+61370182005,88319458829#,*000748# Australia
+61731853730,88319458829#,*000748# Australia

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

Adug meeting 21/2/22

There were about 6 of us in attendance at the shed last night.
With another few online.

There was a bit of a Soap box at the start, Brian asked about XML
verification in Delphi. He has one in C# that works quite well, and
would like one in Delphi (maybe).

Robert Horbury-Smith gave a presentation on Elevate Web Builder.
Current version is 3.

It seems good, build your forms and event handlers using very Object
Pascal like code, and Delphi Like form builder, and it gets turned into
Javascript, and HTML.

Has a client side dataset component.

Elevate has it’s own web server, but for secure production purposes
Robert recommended using the Mormot one. He spent a lot of time looking
at solutions, and Elevate with Mormot won out.

Mormot is free, open source, its downside is its learning curve…

Integration with Mormot, for Version 3 is coming, (so need to use V2 at
present) V3 has much better debugging.

Seems Reasonably priced.
There are a bunch of 3rd party addons (controls), books etc.
Erick Engelke, (He is very smart, so books may be less easy)

We had a short break.

John McDonald then gave a demo of Functional programming using Object
Pascal. (Using Lazarus/fpc, as his Delphi VM is currently unhappy)

Some advantages of functional programming are that things can be proved
to be correct much easier. And they can scale well. Good Multi Threaded.

There are no procedures, as to be of use a procedure needs to cause a
side effect.

No Side Effects, No Mutable variables.

Need to think about things quite differently to Object Oriented.

He showed how you could rewrite the Factorial and Fibonnaci functions in
a functional way such that there were no mutable variables used. It did
require recursion.

And then what was needed to make the recursion optimizable.

C# and Delphi don’t do Recursion optimization, but we found that with
the right switches FPC does do Tail Recursion optimization.
{$OPTIMIZATION TAILREC}

This was demonstrated with a large fibonnaci calculation where the
program would crash with a stack overflow, but then with the TAILREC
optimization it would complete. (Not accurately though, as the result was
well beyond an Int64’s range).

During the discussion while John was showing us the examples there was a
mention of Haskall, which reminded me how reading the code and
description for the quicksort algorithm in the Haskall intro (not
recently) gave me much better insight into how quicksort actually
worked.

https://wiki.haskell.org/Introduction#Quicksort_in_Haskell

Thank you to Robert and John for presenting at short notice
And to all the attendee’s

Roger

4 Likes

That is a terrific summary. Thanks so much, @Roger_Plant :+1::+1:

Just a quick question - a bit OT.
In regard to Presentation code that gets uploaded to the ADUG Server, is it possible for us to make them more visible and downloadable ?

1 Like

@Graeme (Graeme Keast) asked about readability of functional code, and I had been wanting to have examples of this (in Haskell) on hand … so here are a few.

  • It doesn’t show ‘product types’ - they are essentially just like our Record. They are an “and” data type.
  • | is a ‘sum type’ constructor - like a c / c++ union or delphi variant record. They are an “or” data type.

Also Haskell doesn’t need brackets except to force precedence, so

  • Fact is a function, so Fact 10 would be Fact(10) for us
  • List a is a type constructor, so List Int would be TList < integer >

Hi Paul

Does a definition containing … ( … ) … mean that the ‘expression’ within the parenthesis is optional?

Regards
Graeme

Hi Graeme. It is doing grouping / precedence (if I have the right words).

So a List is a type constructor that isn’t complete until it is given a type … that is the “List a” part.

and it can either be “empty” … or else it is an instance of the generic type “a” plus a “List a”. (which eg might be empty)

Likewise a “Tree a” also needs to be provided a type … and then it is a Leaf of type “a” … or else a “Tree a” plus a “Tree a”
That would make a tree that only has information in the leaves.

I edited the Tree text in making the picture. I probably should leave out the “Branch” part.

I was trying to mimic a definition I’ve seen that defines the tree part as (I think) a “Tree a” + “Node a” + “Tree a”
That gives you a tree that also can also have info at the internal nodes.

Then of course you could make it a “Tree a b” that has type “a” in the leaves, and “b” in the nodes.

Pattern matching could be a nice thing to have in Delphi at some stage …

I don’t remember watching this : Computerphile … Tail Recursion.

Sorry. A final example. :slight_smile:

Hi Robert,
I think that might be a work in progress.

Thanks Roger.
Someone at the meeting said that the ADUG Discourse forum can be used to Private Message people. Not sure how that works, but perhaps anyone wanting the source code could give it a try.

1 Like