Forum > General

Simple multithreading code example in Free Pascal

<< < (11/11)

gidesa:

--- Quote from: MarkMLl on September 17, 2024, 08:31:05 pm ---@LV you might find it worth looking at Vector Pascal

http://vectorpascalcom.sourceforge.net/

--- End quote ---

Vector Pascal is written in ... Java!!  :(

MarkMLl:

--- Quote from: gidesa on September 18, 2024, 05:30:22 pm ---Vector Pascal is written in ... Java!!  :(

--- End quote ---

Yes, but the author is a (fairly well-known) CS lecturer, and he's doing it from the POV of having an ALGOL-style language which is capable of handling the same type of problems that APL was (reputedly ** ) good at.

In the first part of the manual he explains why he (and his colleagues/students) chose to extend Pascal (rather than a C-style language or Java), and allowing that by now it's a mature project I think we have to allow him a fair amount of slack (a few years later he'd have added stuff to Perl 6 *** , and these days he'd use Python... so let us be thankful).

There's also a few insights in there: for example, a for statement can be vectorised/parallelised so /of/ /course/ the control variable has no defined value on completion.

I don't have a "real" project to exercise it, but I think it would be interesting to code something using VP's reduction operator, dot product and so on, and then investigate the extent to which FPC could be massaged to do the same. The important thing is that languages such as APL (and for that matter PROLOG etc.) provided a notation style that practitioners in various fields were happy with for 30 years or so, and from my POV the more closely a general-purpose language can replicate that style (without the kitchen sink overflowing with syntactic sugar) the better.

** Provided that you don't look too closely at how much memory was used, and ignored the risk of even the biggest machines thrashing. However a significant amount of this was offset in higher-end implementations, which were smart enough to be able to "reason" about certain structures of array and manipulate their description rather than their (potentially-large) content.

*** https://web.archive.org/web/20201112030222/www.dlugosz.com/Perl6/web/APL.html

MarkMLl

Navigation

[0] Message Index

[*] Previous page

Go to full version