Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Peter B via fpc-pascal
On 06/01/2024 19:05, Matthew Phillips via fpc-pascal wrote: I compiled the Hello World program from the docs and noticed that it's 435k. Compared to a lot of newer languages, like Golang, that's not bad at all. I then compiled the equivalent C program with gcc which came out at 33k. So I'm just

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Adriaan van Os via fpc-pascal
Peter B via fpc-pascal wrote: Try building with smartlinking, -XX I get 35k You can also experiment with ld linker options like --strip-all and --strip-debug or run the produced code through strip with various options (e.g. -u -r on

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Florian Klämpfl via fpc-pascal
> Am 06.01.2024 um 20:05 schrieb Matthew Phillips via fpc-pascal > : > > I compiled the Hello World program from the docs and noticed that it's > 435k. Compared to a lot of newer languages, like Golang, that's not bad > at all. > > I then compiled the equivalent C program with gcc which came

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Sven Barth via fpc-pascal
Am 07.01.2024 um 10:01 schrieb Florian Klämpfl via fpc-pascal: Am 06.01.2024 um 20:05 schrieb Matthew Phillips via fpc-pascal : I compiled the Hello World program from the docs and noticed that it's 435k. Compared to a lot of newer languages, like Golang, that's not bad at all. I then

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Peter B via fpc-pascal
Try building with smartlinking, -XX I get 35k Thats with 3.2.2 on linux ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] What's in Hello World

2024-01-07 Thread Matthew Phillips via fpc-pascal
I compiled the Hello World program from the docs and noticed that it's 435k. Compared to a lot of newer languages, like Golang, that's not bad at all. I then compiled the equivalent C program with gcc which came out at 33k. So I'm just curious, where does the difference comes from? Could it be

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Michael Van Canneyt via fpc-pascal
On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote: Am 07.01.2024 um 10:01 schrieb Florian Klämpfl via fpc-pascal: Am 06.01.2024 um 20:05 schrieb Matthew Phillips via fpc-pascal : I compiled the Hello World program from the docs and noticed that it's 435k. Compared to a lot of newer

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread James Richters via fpc-pascal
>Try building with smartlinking, -XX I never knew there was an option for smartlinking. I'm using the FPC text IDE, I see various options like Generate Smaller Code, and level 1, 2, and 3 optimizations, but I don't see anything specifically called smartlinking. Is it the same as Generate

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Ingemar Ragnemalm via fpc-pascal
Just for comparison, I fired up Think Pascal and made Hello world! Plain Hello world, closes so quickly that you don't have time to see it: 4625 bytes. Including ShowText and while not Button do; 4639 bytes. Yes, less than 5k! Progress? /Ingemar

Re: [fpc-pascal] Quiz

2024-01-07 Thread Michael Van Canneyt via fpc-pascal
On Sun, 7 Jan 2024, Adriaan van Os via fpc-pascal wrote: Quiz. Which of below constant declarations are accepted by the compiler and what is their value ? const ki1 = + 2; ki2 = +2; +x is a unary expression. ki3

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Sven Barth via fpc-pascal
Am 07.01.2024 um 11:39 schrieb Michael Van Canneyt via fpc-pascal: On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote: Am 07.01.2024 um 10:01 schrieb Florian Klämpfl via fpc-pascal: Am 06.01.2024 um 20:05 schrieb Matthew Phillips via fpc-pascal : I compiled the Hello World program

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Michael Van Canneyt via fpc-pascal
On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote: - FPC compiled as is: 388976 B - FPC compiled with full smartlinking: 55920 B - FPC compiled with C linkage: 388760 B - FPC compiled with full smartlinking and C linkage: 56792 B Maybe it is a good idea to add these numbers to the above

[fpc-pascal] Quiz

2024-01-07 Thread Adriaan van Os via fpc-pascal
Quiz. Which of below constant declarations are accepted by the compiler and what is their value ? const ki1 = + 2; ki2 = +2; ki3 = 2+; kr1 = 1.; kr2

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Jonas Maebe via fpc-pascal
On 07/01/2024 13:21, Ingemar Ragnemalm via fpc-pascal wrote: Just for comparison, I fired up Think Pascal and made Hello world! Plain Hello world, closes so quickly that you don't have time to see it: 4625 bytes. Including ShowText and while not Button do; 4639 bytes. Yes, less than 5k!

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Florian Klämpfl via fpc-pascal
> Am 07.01.2024 um 13:21 schrieb Ingemar Ragnemalm via fpc-pascal > : > > Just for comparison, I fired up Think Pascal and made Hello world! > > Plain Hello world, closes so quickly that you don't have time to see it: 4625 > bytes. > > Including ShowText and while not Button do; 4639 bytes.

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Marco van de Voort via fpc-pascal
Op 7-1-2024 om 11:23 schreef Sven Barth via fpc-pascal: To underline this with some numbers (I assume you mean the demo/text/hello.pp which only contains a mere "Writeln('Hello World')" and no additional units; all tests on x86_64-linux with 3.3.1): - FPC compiled as is: 388976 B - FPC

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Karoly Balogh via fpc-pascal
Hi, On Sun, 7 Jan 2024, Ingemar Ragnemalm via fpc-pascal wrote: > Just for comparison, I fired up Think Pascal and made Hello world! > > Plain Hello world, closes so quickly that you don't have time to see it: 4625 > bytes. > > Including ShowText and while not Button do; 4639 bytes. > > Yes,

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Rainer Stratmann via fpc-pascal
Am Sonntag, 7. Januar 2024, 14:09:24 CET schrieb Florian Klämpfl via fpc- pascal: > > Am 07.01.2024 um 13:21 schrieb Ingemar Ragnemalm via fpc-pascal > > : > > > > Just for comparison, I fired up Think Pascal and made Hello world! > > > > Plain Hello world, closes so quickly that you don't have

Re: [fpc-pascal] Quiz

2024-01-07 Thread Tomas Hajny via fpc-pascal
On 2024-01-07 20:47, Michael Van Canneyt via fpc-pascal wrote: On Sun, 7 Jan 2024, Adriaan van Os via fpc-pascal wrote: . . There is some special handling for 1. (ending with a dot) due to Delphi/TP compatibility, they accept it. . . kr5 = 1 . e + 2;

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Karoly Balogh via fpc-pascal
Hi, On Sun, 7 Jan 2024, Michael Van Canneyt via fpc-pascal wrote: > > To underline this with some numbers (I assume you mean the > > demo/text/hello.pp which only contains a mere "Writeln('Hello World')" > > and no additional units; all tests on x86_64-linux with 3.3.1): > > > > - FPC compiled

Re: [fpc-pascal] What's in Hello World

2024-01-07 Thread Karoly Balogh via fpc-pascal
Hi, On Sun, 7 Jan 2024, Florian Klämpfl via fpc-pascal wrote: >> Am 07.01.2024 um 13:21 schrieb Ingemar Ragnemalm via fpc-pascal >> : >> >> Just for comparison, I fired up Think Pascal and made Hello world! >> >> Plain Hello world, closes so quickly that you don't have time to see >> it: 4625