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

2024-01-11 Thread DougC via fpc-pascal
Ah, yes! The Hello World Machine. Doug C. On Thu, 11 Jan 2024 14:34:29 -0500 Adriaan van Os via fpc-pascal wrote --- Nikolay Nikolov via fpc-pascal wrote: > But that increases the binary size to 28 bytes. We can put a 'ret' That's still 27 bytes too much. Let's design a

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

2024-01-11 Thread Adriaan van Os via fpc-pascal
Nikolay Nikolov via fpc-pascal wrote: But that increases the binary size to 28 bytes. We can put a 'ret' That's still 27 bytes too much. Let's design a CPU that has "Hello World" as a one-byte instruction, implement that CPU in a Field-programmable gate array, write an OS for it and let it

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

2024-01-11 Thread Nikolay Nikolov via fpc-pascal
On 1/7/24 14: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-08 Thread Marco van de Voort via fpc-pascal
Op 7-1-2024 om 16:09 schreef Travis Siegel via fpc-pascal: Not that it's 100 percent relevant, but I always use powerbasic (https://www.powerbasic.com) when it's a matter of size, I also never use powerbasic. ___ fpc-pascal maillist -

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

2024-01-08 Thread Travis Siegel via fpc-pascal
On 1/7/2024 1:09 PM, 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 bytes. Including

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

2024-01-08 Thread Travis Siegel via fpc-pascal
For what it's worth, the hello world program in powerbasic (https://www.powerbasic.com) comes to a whooping 7,168 bytes. That's the console version, not the gui version, that's a bit bigger, but by not much more.  I have an epub reader I've been working on for a few years, on and off, and that

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

2024-01-08 Thread Jean SUZINEAU via fpc-pascal
Le 08/01/2024 à 13:51, Peter B via fpc-pascal a écrit :    or if not, is there another way to turn it on in the textmode IDE? No idea. Its easy enough if you compile from the command line. fpc -Os -XX hello.pas If stripping is not on by default, also use -Xs I guess that in the textmode IDE

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

2024-01-08 Thread Karoly Balogh via fpc-pascal
Hi, On Mon, 8 Jan 2024, Marco van de Voort via fpc-pascal wrote: > > Op 8-1-2024 om 14:03 schreef Karoly Balogh via fpc-pascal: > > No, it's not. But the Linker specific options are under Options -> > > Linker... There's a smartlinking related option there, but I'm not sure if > > it is what you

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

2024-01-08 Thread Marco van de Voort via fpc-pascal
Op 8-1-2024 om 14:03 schreef Karoly Balogh via fpc-pascal: No, it's not. But the Linker specific options are under Options -> Linker... There's a smartlinking related option there, but I'm not sure if it is what you need. :) That one is -XX, and the "create smartlinkable units" in the tab

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

2024-01-08 Thread code dz via fpc-pascal
I remember i made a simple win32 window app with custom tiny RTL , and final exe size was 4.5kb . On Sun, Jan 7, 2024, 20:33 Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > On Sun, 7 Jan 2024, Sven Barth via fpc-pascal wrote: > > >>> > >>> - FPC compiled as

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

2024-01-08 Thread Karoly Balogh via fpc-pascal
Hi, On Sun, 7 Jan 2024, James Richters via fpc-pascal wrote: > >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 >

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

2024-01-08 Thread Peter B via fpc-pascal
On 07/01/2024 16:07, James Richters via fpc-pascal wrote: 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

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

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, 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] 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 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

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 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 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 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 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] 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 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

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 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
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 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

[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