Jump to content

Small application's?


Skitty
 Share

Recommended Posts

~ After using autoit for a while, I noticed its file size was big for what it would do, and yes I know why >_>

~ I made a stupid msgbox and gui app in c++ and the resulting file was over 900kb...

~ Which made me unhappy :)

My question is, what language do I use to create small apps (like 50kb apps).

Also, if I made an app in python under linux, will it run in windows?

how do I make multi platform applications?

Link to comment
Share on other sites

If you want really small fast applications then you need to write them in assembler. It's possible to create something such as a a better version of notepad that is only 6K. Although these days with lots of RAM available on most PC and the performance of CPUs now I rarely worry about the sizes or speed of my applications. The speed and ease with which I can develop an application in AutoIt usually wins the day for me. If a need more speed then I'll use C++ without using MFC or .Net.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Link to comment
Share on other sites

If you want really small fast applications then you need to write them in assembler. It's possible to create something such as a a better version of notepad that is only 6K. Although these days with lots of RAM available on most PC and the performance of CPUs now I rarely worry about the sizes or speed of my applications. The speed and ease with which I can develop an application in AutoIt usually wins the day for me. If a need more speed then I'll use C++ without using MFC or .Net.

C++ can be compiled to as small executables as any program with similar characteristics written in some assembly level language. It's all about settings.

edit: even smaller because programmer's abilities plays big role regarding the size of assembly programs.

Edited by trancexx
Link to comment
Share on other sites

I created an empty program with Visual C++ Express 2010. The executable built by the Release configuration has 6KB. Are you linking statically to the CRT, or building as Debug?

I was compiling in dbg mode, but code blocks seem's to create large files regardless.

I must be doing something wrong.

Edited by System238
Link to comment
Share on other sites

~ I made a stupid msgbox and gui app in c++ and the resulting file was over 900kb...

It sounds like you created an MFC application. The last time I checked a non-MFC simple GUI application was ~50kb before aggressive setting optimizations.

.Net executables are pretty portable. They are small and compile to native speed.

Umm, no. .NET applications are not small, ever. There's this big honkin' runtime environment requirement which is not small.
Link to comment
Share on other sites

But the assemblies themselves are small. Also, I wouldn't say a 30 MB client runtime is bad especially if you compare it to Java's 160 MB download.

Lolwut? The offline installers for both the 32-bit and 64-bit versions of Java are 16MB each. Most people don't even need both, I only have the 64-bit version so I can run Minecraft with it since it gives better performance and allows me to allocate more memory. Maybe the development package for Java is 160MB but the client run-time is nowhere close to that.

Either way, 30MB is a far cry from a minimalistic 50KB or less binary that C++ can produce relying on nothing but the operating system. That's statically linking against MSVCRT, too, so no need to provide the redistributable for that.

Link to comment
Share on other sites

Manadar, statowl shows the difference between .NET 3 and 4 dropped from >10% to <2% when you change from the last 6 months to the last 3 which implies that .NET will soon be the majority. Changing the target framework in the project settings is not that hard anyway.

The smallest program I've ever written that was actually useful was 8kb (here). That was written in assembler because it was easier than writing it in AutoIt or .NET (both of those would have taken more lines to do it :) )

How about you consider AutoIt3.exe to be a runtime? You can "statically link" it too :)

Link to comment
Share on other sites

Manadar, statowl shows the difference between .NET 3 and 4 dropped from >10% to <2% when you change from the last 6 months to the last 3 which implies that .NET will soon be the majority. Changing the target framework in the project settings is not that hard anyway.

Yes, but they are backwards compatible. If people have 4.0 they will have 3.5. So 3.5 is 90% usage and 4.0 only 40%.
Link to comment
Share on other sites

Lolwut? The offline installers for both the 32-bit and 64-bit versions of Java are 16MB each. Most people don't even need both, I only have the 64-bit version so I can run Minecraft with it since it gives better performance and allows me to allocate more memory. Maybe the development package for Java is 160MB but the client run-time is nowhere close to that.

Either way, 30MB is a far cry from a minimalistic 50KB or less binary that C++ can produce relying on nothing but the operating system. That's statically linking against MSVCRT, too, so no need to provide the redistributable for that.

I could very well be remembering Java wrong.

That's 30 MB once rather than 50 KB in every executable. A little more than 600 C++ executables worth of runtime. Shared resources are easier to update.

Link to comment
Share on other sites

Manadar, statowl shows the difference between .NET 3 and 4 dropped from >10% to <2% when you change from the last 6 months to the last 3 which implies that .NET will soon be the majority. Changing the target framework in the project settings is not that hard anyway.

The smallest program I've ever written that was actually useful was 8kb (here). That was written in assembler because it was easier than writing it in AutoIt or .NET (both of those would have taken more lines to do it :) )

How about you consider AutoIt3.exe to be a runtime? You can "statically link" it too :)

I just ditched code::Blocks and acquired myself vb2010 and must say I like the file size.

the little examples that came with it compile into an average of 30kb!

Now all I need to do is understand its syntax and know what the hell I'm doing.

Anyway, I'm interested in assembly and will look up on that if it really allows for apps the size of 8kb,

Edited by System238
Link to comment
Share on other sites

Ew VB.

what?... whats wrong with vb?

Edit: assembly looks so easy like the windows batch scripts! any one know where I can indulge into this FASM if thats the word....

include 'win32a.inc'

WM_HIT = WM_USER + 1

section '.text' code readable executable

  start:
    invoke  RegisterClass,wc
    invoke  CreateWindowEx,0,sClass,sClass,0,0,0,0,0,0,0,0,0
    mov [hWnd],eax

    invoke  GetModuleHandle,0
    invoke  SetWindowsHookEx,WH_MOUSE_LL,HookProc,eax,0
    mov [hHk],eax

Edit: how do I compile asm?

Edit: nvm heres a link.

Edited by System238
Link to comment
Share on other sites

I could very well be remembering Java wrong.

That's 30 MB once rather than 50 KB in every executable. A little more than 600 C++ executables worth of runtime.

I have 8,617 *.exe files according to Windows search. Unfortunately I have no way of checking, however, I would be very surprised if I have anywhere close to 600 executables using any runtime (Java or .NET). I imagine the vast majority of these are C\C++ applications. Off the top of my head I have the following Java applications: Minecraft, Minecraft Patcher (for installing HD texture packs), Java's utilities. A far cry from 600. As for .NET I only personally have a half dozen or so applications that use it. I'm sure Windows has more. The only .NET processes I have running are: PresentationFontCache, Microsoft Management Console (viewing the event log), ATI Catalyst Control Center (2 processes, MOM and CCC). So 4 .NET programs running. I don't know that I've ever had 6 .NET programs running at once on this system.

Shared resources are easier to update.

I'm not so sure about that. In some cases, maybe. There is an advantage to having a bug fixed and all applications using that single object getting the fix for free. This, however, is still possible with native code and DLLs.

People should choose to use a .NET language (or any other language with a runtime) based upon features of the language, not because it produces a small-appearing executable. To claim that .NET produces a small executable is disingenuous at best since it requires a runtime that is not small compared to what the application would be in native code.

I just ditched code::Blocks and acquired myself vb2010 and must say I like the file size.

Why VIsual Basic? If you're going to use a .NET language then use C#. It's the flagship language for the .NET platform, it has the best support and the best tools. You're using what is essentially a dead-end language that people don't care about. I think that is the crux of Richard's "ew".
Link to comment
Share on other sites

I have 8,617 *.exe files according to Windows search. Unfortunately I have no way of checking, however, I would be very surprised if I have anywhere close to 600 executables using any runtime (Java or .NET). I imagine the vast majority of these are C\C++ applications. Off the top of my head I have the following Java applications: Minecraft, Minecraft Patcher (for installing HD texture packs), Java's utilities. A far cry from 600. As for .NET I only personally have a half dozen or so applications that use it. I'm sure Windows has more. The only .NET processes I have running are: PresentationFontCache, Microsoft Management Console (viewing the event log), ATI Catalyst Control Center (2 processes, MOM and CCC). So 4 .NET programs running. I don't know that I've ever had 6 .NET programs running at once on this system.

I'm not so sure about that. In some cases, maybe. There is an advantage to having a bug fixed and all applications using that single object getting the fix for free. This, however, is still possible with native code and DLLs.

People should choose to use a .NET language (or any other language with a runtime) based upon features of the language, not because it produces a small-appearing executable. To claim that .NET produces a small executable is disingenuous at best since it requires a runtime that is not small compared to what the application would be in native code.

Why VIsual Basic? If you're going to use a .NET language then use C#. It's the flagship language for the .NET platform, it has the best support and the best tools. You're using what is essentially a dead-end language that people don't care about. I think that is the crux of Richard's "ew".

You know a lot about scite, how can I get it to use FASM.exe to compile my asm sources? I was just trying it and noticed that scite's compile button is active when viewing asm files.

Is there a way to config scite into using this asm compiler for asm files?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...