Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Small application's?


  • Please log in to reply
28 replies to this topic

#1 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 28 March 2011 - 09:21 PM

~ 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?
Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.








#2 danielkza

danielkza

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 28 March 2011 - 09:53 PM

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?

Edited by danielkza, 28 March 2011 - 09:54 PM.


#3 Bowmore

Bowmore

    Feinschmecker

  • Active Members
  • PipPipPipPipPipPip
  • 836 posts

Posted 28 March 2011 - 10:22 PM

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

#4 trancexx

trancexx

    Queen F. Elizabeth MCXI

  • Active Members
  • PipPipPipPipPipPip
  • 6,246 posts

Posted 28 March 2011 - 11:00 PM

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, 28 March 2011 - 11:05 PM.

...... ......
.:oOOOOo:. .:oOOOOo:.
.:oOO:'':Oo:. .:oO:'':OOo:.
.:oO: 'Oo:oO' :Oo:.
:oO: 'o'
:Oo:
:oO: :Oo:
':oO: OT9AO0IEDrk :Oo:'
':oO: :Oo:'
':oO. .Oo:'
':oO
. .Oo:'
':oO. .Oo:'
':oO. .Oo:'
'oO:Oo'
'o' :kiss:





.
eMyvnE


#5 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,333 posts

Posted 29 March 2011 - 12:20 AM

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

#6 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 29 March 2011 - 01:46 AM

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, 29 March 2011 - 01:46 AM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#7 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 29 March 2011 - 01:54 AM

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

#8 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,333 posts

Posted 29 March 2011 - 04:37 AM

Umm, no. .NET applications are not small, ever. There's this big honkin' runtime environment requirement which is not small.

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.

#9 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 29 March 2011 - 06:46 AM

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.

#10 Manadar

Manadar

         

  • MVPs
  • 10,893 posts

Posted 29 March 2011 - 07:01 AM

I'd still recommend to write in .NET. Look at some statistics: http://www.statowl.com/microsoft_dotnet.php

I'd also recommend to write for .NET 3.5 if you want a broader audience.

#11 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 5,067 posts

Posted 29 March 2011 - 08:35 AM

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

#12 Manadar

Manadar

         

  • MVPs
  • 10,893 posts

Posted 29 March 2011 - 09:37 AM

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

#13 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,333 posts

Posted 29 March 2011 - 02:45 PM

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.

#14 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 29 March 2011 - 03:15 PM

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, 29 March 2011 - 03:17 PM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#15 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,333 posts

Posted 29 March 2011 - 03:19 PM

Ew VB.

#16 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 29 March 2011 - 03:29 PM

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, 29 March 2011 - 03:39 PM.

Spoiler

Warning: Posts by this user are subject to change or may disappear without notice.


#17 Richard Robertson

Richard Robertson

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 10,333 posts

Posted 29 March 2011 - 03:45 PM

Assembly can be a lot of fun but it can also eat your entire computer if you do it wrong (or right if that was your intent).

#18 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 29 March 2011 - 04:13 PM

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

#19 CaptainClucks

CaptainClucks

    Unum Cavillator Spuria

  • Active Members
  • PipPipPipPipPipPip
  • 1,227 posts

Posted 29 March 2011 - 04:19 PM

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

Warning: Posts by this user are subject to change or may disappear without notice.


#20 Valik

Valik

    Former developer.

  • Active Members
  • PipPipPipPipPipPip
  • 18,879 posts

Posted 29 March 2011 - 04:23 PM

  • Start SciTE.
  • Click "Help" on the menu bar.
  • Click "Help" in Help submenu.
  • ???
  • Profit.

Edited by Valik, 29 March 2011 - 04:24 PM.

  • James likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users