|
Post by Pjot on Dec 13, 2012 9:03:18 GMT 1
As usual, you have to provide some compiler flags to gcc, so it optimizes the result. For example:
This should reduce the size of the executable a little bit more...
BR, Peter
|
|
|
Post by vovchik on Dec 13, 2012 9:42:02 GMT 1
what about: bacon -o -s -o -Os -o -fdata-sections -o -ffunction-sections -o -Wl,--gc-sections iup.bac This gives me a 9536 byte executable in Lucid. When upx'd it is 5864!
|
|
|
Post by vovchik on Dec 13, 2012 15:10:53 GMT 1
We just have to know the commands to the compiler....and then things are tiny
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 13, 2012 16:19:53 GMT 1
Just compare the C source BaCon generates to what BCX generates and it's obvious Peter needs another pass to remove all the dead code that automatically goes along for the ride. It would be near impossible to do anything at the C level with BaCon generated code. The BCX version is well laid out and looks like C code.
|
|
|
Post by vovchik on Dec 13, 2012 17:24:12 GMT 1
Don't want to be pushy - but BCX generates c++ code, not pure C, as I understand - so we are comparing apples and oranges. Correct me if I am mistaken.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 13, 2012 17:31:15 GMT 1
BCX9 is a C translator where the BCX variations like MBC and UBC are tailored for C++ code generation.
|
|
|
Post by Pjot on Dec 13, 2012 21:08:26 GMT 1
The code is not dead but contains stuff which each program potentially can use. It works pretty well so why strip it? Next to that, the resulting executable can be small nevertheless, can it?
Well, what is the use of generating C source code, after which one needs to fiddle around in that code to get the job done? Then better adjust your BASIC program or improve the BASIC implementation as a whole. My point is, BaCon does the job, doesn't it?
That is definitely true.
Best regards Peter
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 13, 2012 21:16:38 GMT 1
Peter,
You started the BaCon project using a BASH script which was amazing in itself. BaCon has matured well along the way. It is what it is and you should be proud of your efforts. (GTK-Server was another amazing feat)
John
|
|
|
Post by jcfuller on Dec 14, 2012 13:04:32 GMT 1
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 14, 2012 15:31:58 GMT 1
If sharing resources among projects is SPAM then open source is in deep sh*t.
|
|
|
Post by bigbass on Dec 16, 2012 2:59:50 GMT 1
Hey vovchik
Thanks for taking the time and posting the C code to BaCon when CASE is needed it makes for a true translation and easy to see what was done to get a working example converted
P.S. I know that you have done a lot of C code to BaCon conversions thanks for your help!
Joe
|
|