ICT: Diary
D: 28 W: 05
| < | May 2015 | > | ||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | ||||||
[ < ]
Monday, 4 May 2015 [ >
]
HookRace: a Nim blog for now.
Interest blog post on reducing a Nim binary from 160 KB to 150 Bytes.
So I used How I Start and ran my nim "hello world" program:
port:fred ~/code/nimcode> ../Nim/bin/nim c hello
/home/fred/code/Nim/config/nim.cfg(53, 3) Hint: added path: '/home/fred/.babel/pkgs/' [Path]
/home/fred/code/Nim/config/nim.cfg(54, 3) Hint: added path: '/home/fred/.nimble/pkgs/' [Path]
Hint: used config file '../Nim/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: hello [Processing]
[Linking]
/home/fred/code/nimcode/nimcache/stdlib_system.o(.text+0xe54e): In function `nimFloatToStr':
: warning: sprintf() is often misused, please use snprintf()
Hint: operation successful (9074 lines compiled; 0.172 sec total; 13.138MB; Debug Build) [SuccessX]
port:fred ~/code/nimcode> ./hello
Hello Nim
The wrote a slightly more complex nim program:
loop.nimvar x = 0 for i in 1 .. 1_000: inc x # increase x echo x echo "Hello nim: ",x," greetings"port:fred ~/code/nimcode> ../Nim/bin/nim c loop /home/fred/code/Nim/config/nim.cfg(53, 3) Hint: added path: '/home/fred/.babel/pkgs/' [Path] /home/fred/code/Nim/config/nim.cfg(54, 3) Hint: added path: '/home/fred/.nimble/pkgs/' [Path] Hint: used config file '../Nim/config/nim.cfg' [Conf] Hint: system [Processing] Hint: loop [Processing] [Linking] /home/fred/code/nimcode/nimcache/stdlib_system.o(.text+0xe54e): In function `nimFloatToStr': : warning: sprintf() is often misused, please use snprintf() Hint: operation successful (9079 lines compiled; 0.336 sec total; 13.138MB; Debug Build) [SuccessX]port:fred ~/code/nimcode> ./loop 1 ... 1000 Hello nim: 1000 greetings
This program failed initially, as I used tabs in the file which gave me:
Error: tabulators are not allowed
replacing with spaces fixed this warning.
Need to finish the How I Start and have a play with the Nim Tutorial.
$Id: dates.htm,v 1
$Id: diary,v 1.38 2025/01/01 22:43:54 fred Exp $