Re: [fpc-other] Interpreter speed

2023-04-30 Thread geneb via fpc-other

On Sun, 30 Apr 2023, Bernd Oppolzer via fpc-other wrote:



Am 29.04.2023 um 19:48 schrieb geneb via fpc-other:

On Sat, 29 Apr 2023, Bernd Oppolzer via fpc-other wrote:

This may be slightly off-topic, but I can tell you some facts about my 
Stanford Pascal compiler,

which runs

- native on z Mainframe machines (which may count as a RISC machine, given 
the instruction set used)

- emulated by Hercules, which is a emulator of z Mainframes
- by emulating P-Code, which is a (sort of) byte code for Pascal ... the 
P-Code (which is pure text, portable)
is translated to a byte code representation before execution; static 
linking is also done in this stage




Bernd, is the dialect used by that compiler "standard" Pascal, UCSD Pascal, 
Turbo-compatible, or?


tnx.

g.



A short "language reference" (23 pages), which covers the differences to 
"standard" Pascal,

is available from this website: http://bernd-oppolzer.de/job9.htm
see the link on top of the page, just below the picture.



Thanks!  I'll take a peek at that.

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby.  Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!
___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] Interpreter speed

2023-04-30 Thread Adriaan van Os via fpc-other

Bernd Oppolzer via fpc-other wrote:
This may be slightly off-topic, but I can tell you some facts about my 
Stanford Pascal compiler,

which runs

- native on z Mainframe machines (which may count as a RISC machine, 
given the instruction set used)

- emulated by Hercules, which is a emulator of z Mainframes
- by emulating P-Code, which is a (sort of) byte code for Pascal ... the 
P-Code (which is pure text, portable)
is translated to a byte code representation before execution; static 
linking is also done in this stage


Interesting, thanks.

Adriaan van Os

___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] Interpreter speed

2023-04-29 Thread Bernd Oppolzer via fpc-other



Am 29.04.2023 um 19:48 schrieb geneb via fpc-other:

On Sat, 29 Apr 2023, Bernd Oppolzer via fpc-other wrote:

This may be slightly off-topic, but I can tell you some facts about 
my Stanford Pascal compiler,

which runs

- native on z Mainframe machines (which may count as a RISC machine, 
given the instruction set used)

- emulated by Hercules, which is a emulator of z Mainframes
- by emulating P-Code, which is a (sort of) byte code for Pascal ... 
the P-Code (which is pure text, portable)
is translated to a byte code representation before execution; static 
linking is also done in this stage




Bernd, is the dialect used by that compiler "standard" Pascal, UCSD 
Pascal, Turbo-compatible, or?


tnx.

g.

The dialect implemented by the New Stanford Pascal compiler is 
"standard" Pascal with some extensions,

for example

- extended const syntax (for structures and arrays etc.)
- support for external procedures (contained in "modules")
- CHAR(n) data type
- string data type
- static definitions
- initializations of variables and statics
- OTHERWISE on CASE
- BREAK, CONTINUE, RETURN
- direct read and write of scalar types (enums)
- with clause on record types
- pointers on variables which are not on the heap
- pointer arithmetic
- many new builtin procedures and functions

A short "language reference" (23 pages), which covers the differences to 
"standard" Pascal,

is available from this website: http://bernd-oppolzer.de/job9.htm
see the link on top of the page, just below the picture.

Kind regards

Bernd

___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] Interpreter speed

2023-04-29 Thread geneb via fpc-other

On Sat, 29 Apr 2023, Bernd Oppolzer via fpc-other wrote:

This may be slightly off-topic, but I can tell you some facts about my 
Stanford Pascal compiler,

which runs

- native on z Mainframe machines (which may count as a RISC machine, 
given the instruction set used)

- emulated by Hercules, which is a emulator of z Mainframes
- by emulating P-Code, which is a (sort of) byte code for Pascal ... the 
P-Code (which is pure text, portable)
is translated to a byte code representation before execution; static 
linking is also done in this stage




Bernd, is the dialect used by that compiler "standard" Pascal, UCSD 
Pascal, Turbo-compatible, or?


tnx.

g.

--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby.  Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://scarlet.deltasoft.com - Get it _today_!
___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] Interpreter speed

2023-04-29 Thread Bernd Oppolzer via fpc-other

On the same machine:

PASCAL1 compiled with Stanford Pascal, running on the Hercules emulator:

pp pascal1
EXEC PASCAL PASCAL1
STATE PASCAL1 PASCAL A
EXEC PASCOMP PASCAL1
    STANFORD PASCAL COMPILER, OPPOLZER VERSION OF 2023.03 

    Compiler Summary 
     No Errors, no Warnings.
      26042 LINE(S) READ,  243 PROCEDURE(S) COMPILED,
      75126 P_INSTRUCTIONS GENERATED,   9.40 SECONDS IN COMPILATION.
EXEC PASC370 PASCAL1
    STANFORD PASCAL POST-PROCESSOR, OPPOLZER VERSION OF 2023.03

     NO ASSEMBLY ERROR(S) DETECTED.
     265999 BYTES OF CODE GENERATED,   8.24 SECONDS IN POST_PROCESSING.
EXEC PASLINK PASCAL1
Ready; T=17.71/27.02 18:17:06

Kind regards

Bernd



Am 29.04.2023 um 18:15 schrieb Bernd Oppolzer:
This may be slightly off-topic, but I can tell you some facts about my 
Stanford Pascal compiler,

which runs

- native on z Mainframe machines (which may count as a RISC machine, 
given the instruction set used)

- emulated by Hercules, which is a emulator of z Mainframes
- by emulating P-Code, which is a (sort of) byte code for Pascal ... 
the P-Code (which is pure text, portable)
is translated to a byte code representation before execution; static 
linking is also done in this stage


The times for compiling the compiler (first pass, 26.000 lines) are as 
follows:


- native on z machine: 0.1 seconds
- emulating z by Hercules using a very old z operating system: 10 to 
12 seconds
- similar (10 to 15 seconds), when running on Windows and emulating 
the P-Code;
this includes the time to translate the P-Code char representation ... 
depending on the

power of the used laptop etc., of course.

This makes a factor of 100 for the two emulation strategies, compared 
to the native execution.


The times are CPU times as reported by the builtin function CLOCK.

Windows example:

c:\work\pascal\work\src>pp pascal1

PCINT (Build 1.0 Jun 15 2022 08:21:21)

    STANFORD PASCAL COMPILER, OPPOLZER VERSION OF 2023.03 

    Compiler Summary 
     No Errors, no Warnings.
      26058 LINE(S) READ,  243 PROCEDURE(S) COMPILED,
      75130 P_INSTRUCTIONS GENERATED,  13.55 SECONDS IN COMPILATION.

*** EXIT Aufruf mit Parameter = 0 ***

HTH, kind regards

Bernd

http://bernd-oppolzer.de/job9.htm


Am 28.04.2023 um 09:20 schrieb Adriaan van Os via fpc-other:

Out of curiosity — has anybody compared the speed of

1. interpreting a parsed syntax tree, versus
2. interpreting byte code, versus
3. interpreting a RISC CPU ?

Regards,

Adriaan van Os

___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other

___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other


Re: [fpc-other] Interpreter speed

2023-04-29 Thread Bernd Oppolzer via fpc-other
This may be slightly off-topic, but I can tell you some facts about my 
Stanford Pascal compiler,

which runs

- native on z Mainframe machines (which may count as a RISC machine, 
given the instruction set used)

- emulated by Hercules, which is a emulator of z Mainframes
- by emulating P-Code, which is a (sort of) byte code for Pascal ... the 
P-Code (which is pure text, portable)
is translated to a byte code representation before execution; static 
linking is also done in this stage


The times for compiling the compiler (first pass, 26.000 lines) are as 
follows:


- native on z machine: 0.1 seconds
- emulating z by Hercules using a very old z operating system: 10 to 12 
seconds
- similar (10 to 15 seconds), when running on Windows and emulating the 
P-Code;
this includes the time to translate the P-Code char representation ... 
depending on the

power of the used laptop etc., of course.

This makes a factor of 100 for the two emulation strategies, compared to 
the native execution.


The times are CPU times as reported by the builtin function CLOCK.

Windows example:

c:\work\pascal\work\src>pp pascal1

PCINT (Build 1.0 Jun 15 2022 08:21:21)

    STANFORD PASCAL COMPILER, OPPOLZER VERSION OF 2023.03 

    Compiler Summary 
     No Errors, no Warnings.
      26058 LINE(S) READ,  243 PROCEDURE(S) COMPILED,
      75130 P_INSTRUCTIONS GENERATED,  13.55 SECONDS IN COMPILATION.

*** EXIT Aufruf mit Parameter = 0 ***

HTH, kind regards

Bernd

http://bernd-oppolzer.de/job9.htm


Am 28.04.2023 um 09:20 schrieb Adriaan van Os via fpc-other:

Out of curiosity — has anybody compared the speed of

1. interpreting a parsed syntax tree, versus
2. interpreting byte code, versus
3. interpreting a RISC CPU ?

Regards,

Adriaan van Os

___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other

___
fpc-other maillist  -  fpc-other@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-other