Florian Klaempfl wrote:
I'am currently thinking about implementing OpenMP support in FPC. However, there is currently (to my knowledge) no pascal syntax defined for OpenMp support. Do you think we can find a common syntax to simplify things for users? I've some ideas how it be done, but I want to hear other ideas first so they are maybe better if they aren't influenced by my ideas :)
I started also a wiki page about it http://www.freepascal.org/wiki/index.php/OpenMP_support where ideas can be written down and shared.
I had a quick look at OpenMP specification some time ago and my first thought was to do obvious thing: declare that OpenMP directives have form of Pascal directives:
{$omp omp_directive}
looking at the wiki page I see that you quickly dismissed such possibility. I would like to mention here what I consider as main advantage of directive approach: it modularizes the specifiaction, allowing independent evolution of the language standard and OpenMP specification.
Some remarks:
1) some (most ??) OpenMP directives make sense only on statements, so it make sense to follow C/Fortran path and attach them to statements 2) directives take extra options/parameters and use a number of keywords so integrating them into Pascal syntax may turn some identifiers into reserved words (breaking compatibility) and/or significantly complicate pascal parser 3) there are other parallel programing paradigms, integrated OpenMP syntax may pre-empt some better solution.