From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <20130323100519.GA3980@polynum.com> <19750d1b50c54941f031f57dc4be456e@proxima.alt.za> <5099C9E8-C6E8-4B6B-A609-B5BDCA6C332F@lsub.org> <5C91EC08-2559-4DA8-B6F3-9293747EEFE8@gmail.com> <20130323173739.GA3314@polynum.com> Date: Sat, 23 Mar 2013 17:45:35 -0600 Message-ID: From: andrey mirtchovski To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] gcc not an option for Plan9 Topicbox-Message-UUID: 321d65ce-ead8-11e9-9d60-3106f5b1d025 > If you want real programs which are bigger that I (we) actually use that will > be (much) bigger in go: > > ls, cp rm mv cat acid, I can go on. > > Small programs are useful and important. here's a representative set. the programs are identical in behaviour and arguments to the Plan 9 set. the size is as reported by du, in kilobytes: 1456 ./date/date 1460 ./cat/cat 1564 ./cleanname/cleanname 1564 ./tee/tee 1736 ./echo/echo 1764 ./cp/cp 1772 ./uniq/uniq 1780 ./cmp/cmp 1780 ./freq/freq 1780 ./wc/wc 1792 ./comm/comm > binaries are bigger and for example replacing the minimal sets of commands of > the system, this can make the > minimal system at least 5 times bigger easy. if that was a real issue you were trying to solve there are things you can do to help yourself. most notably sticking everything in a single binary and invoking the right function based on your argv0. it took me less than 15 minutes to convert the above code to work as a single binary and most of that was in handling clashing flags (it would've been a non-issue if I had used flagsets when writing the original programs). size at the very end: $ date > test.txt $ ln -s $GOPATH/bin/all cat $ ln -s $GOPATH/bin/all wc $ ./cat test.txt Sat Mar 23 17:32:42 MDT 2013 $ ./wc test.txt 1 6 29 test.txt $ du -k $GOPATH/bin/all 1888 /Users/andrey/bin/all the size of the original binaries on plan9 is 588k. what was a factor of 30 is now a factor of 3. all tests still pass and it took less time to complete than writing this email. there's an even better solution, but it won't work on plan9 because the go tool is slow there :)