Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2025/26/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Nim2
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Compilation

$ nim c prg.nim

𝥶Compiles the program in debug mode. Faster compilation, slower EXE.

$ nim c -d:release prg.nim

𝥶Compiles the program in release mode. Slower compilation, fast EXE. The EXE is smaller.

Create a small EXE

I took the same program and compiled it with different options. File sizes are indicated.

$ nim c prg.nim                                              # 98336 bytes

$ nim c -d:release prg.nim                                   # 69288 bytes

$ nim c -d:release --opt:size prg.nim                        # 38168 bytes

$ nim c -d:release --opt:size --passL:-s prg.nim             # 27120 bytes

$ nim c -d:release --opt:size -d:quick --passL:-s prg.nim    # 26912 bytes

"--passL:-s" calls "strip -s"

Applying UPX

If you want to further minimize the size of the binary, you can also experiment with upx. Take the smallest binary and try these:

$ upx <binary>           # fast; good compression

$ upx --best <binary>    # better compression

$ upx --lzma <binary>    # even better than "--best" :)

After UPX, always try the EXE to check if it still works.

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2026 March 19, 21:42