Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing exe, can u make them smaller in size?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ReN3g@de




PostPosted: Thu Apr 15, 2004 3:45 pm   Post subject: Turing exe, can u make them smaller in size?

i made a little program and its about 97 lines or so... i want to allow others to use it and i wanna be able to send it via msn and icq... when i compiled the prog it came out to 999kb!!! and it would take a while to transfer on msn and icq so i was wondering if there is anyway to make the compiled exe a bit smaller in size?
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Thu Apr 15, 2004 4:17 pm   Post subject: (No subject)

No, there is not.

Unlike any other programming language, Turing does not have the ability to do things like this:

code:

import javax.swing.*;
import java.awt.*;
import java.lang.String.*;

That is Java. As you can see, it imports bits and pieces of the main code into the file to be used. It only imports what is needed. Turing, on the other hand, slams the whole darned sha-bang into any programme that you turn to exe (I'm not positive about the GUI imports though).

Thus, a programme such as:
code:

put "Hello World!"

though only a couple of bytes in size, will
a) take up at the least 32kB on disk due to the way Turing saves files
b) when compiled take up +500kB, as Turing includes all the commands for the computer to do things like 'get', 'Draw.', 'Mouse.', 'File.', etc etc etc, even though they are not used.

Best advice, zip it.
recneps




PostPosted: Thu Apr 15, 2004 7:02 pm   Post subject: (No subject)

yeah, easiest way is to zip it.. i went from 700kb prog to like 200kb
and if you are advanced, you could probably back up the "predefs.lst" file (it says that at bottom when you compile it) and edit it to get rid of anything you arent using ;D (not recommended.. probably wont work anyway Very Happy)
Tony




PostPosted: Thu Apr 15, 2004 9:34 pm   Post subject: (No subject)

heh, taking out Net should save quite a bit of size.

You can remove Sprites or better yet - replace them with DanSprite so that they would actually work.

also all this useless junk
Quote:

% Contains routines no longer supported
"%oot/support/predefs/Obsolete.tu"

% Contains student named versions of routines (all lowercase)
"%oot/support/predefs/Student.tu"

% Future expansion (reserving keywords)
"%oot/support/predefs/Future.tu"
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Catalyst




PostPosted: Thu Apr 15, 2004 10:22 pm   Post subject: (No subject)

if u dont include any of the predefs the exe is still 669k (taking everything out of predefs.lst)
i think thats the turing interpreter
Tony




PostPosted: Thu Apr 15, 2004 11:05 pm   Post subject: (No subject)

would it not have made more sence to just compile the program to machine code instead of injecting it into interpriter file? I mean not only is it huge in size (relative to a tiny program) but it's also slow as the code has to be interprited every time it is run Rolling Eyes
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Catalyst




PostPosted: Thu Apr 15, 2004 11:39 pm   Post subject: (No subject)

maybe they wanted to make it easier to make it cross-platform?
(or its not an interpreter)
Tony




PostPosted: Fri Apr 16, 2004 12:16 am   Post subject: (No subject)

Catalyst wrote:
easier to make it cross-platform?


'cept that you see how the only other platform they support are macs... and how they stoped any mac updates after the version... 1.5.1 Shocked
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Catalyst




PostPosted: Fri Apr 16, 2004 6:14 am   Post subject: (No subject)

just went to thieir site it seems its compiled to a byte-code then interpreted

Quote:

Turing is a pseudo-compiler. (A what?) A pseudo-compiler is technology half way between a pure interpreter and a pure compiler. When you run a program in Turing, it translates the program not into machine-code, but into what is called pseudo-code. Pseudo-code resembles a sort of generic machine-code. It is not specific to any processor, but it follows the generalities of what most machine-codes look like.

Because it is a generic language, translation from Turing to pseudo-code is very quick. In general, compilation time is measured in tenths of seconds to seconds for very long programs (although you can wait a few seconds when Turing runs the first time as it compiles several hundred lines of predefined subprograms in various modules).

Execution speed is also somewhere between a compiler and an interpreter. When the program is running, Turing is translating the pseudo-code into machine language instructions and executing them. However, because there is a strong resemblance between pseudo-code and machine-code on most processors, the translation is fairly efficient and quick. The Turing pseudo-compiler executes about half as fast as a true compiler and about five times faster than a true interpreter.

Using a pseudo-code compiler also greatly enhanced portability between machines. This has allowed us to create versions of Turing for the PC, ICON, Macintosh, SUN, VAX and IBM mainframes.
Dan




PostPosted: Fri Apr 16, 2004 10:51 pm   Post subject: (No subject)

that pseudo-compile thing i have hured was only for verson 3.x and down. i have hured that 4.x dose not do that and that is why so many things where lost. if it is still ture then they are probly still liculding all the C++ lib files that they need to make the code in to c++ and then compile it.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
the_short1




PostPosted: Sun Apr 18, 2004 4:58 pm   Post subject: (No subject)

i think for the next version of turing...

when u press compile... it should read all your code and auto matically include the files u need... but nothing more... that wwould save lots of compile time... and file size..
ReN3g@de




PostPosted: Mon Apr 19, 2004 6:31 pm   Post subject: (No subject)

YES!!! i agree
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 12 Posts ]
Jump to:   


Style:  
Search: