9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: andrey mirtchovski <mirtchovski@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] gcc not an option for Plan9
Date: Sat, 23 Mar 2013 13:13:53 -0600	[thread overview]
Message-ID: <CAK4xykW1Mr3wMV6ECdHvfCnM6tJD-d-=nMj8cXpL3scMO8ETQA@mail.gmail.com> (raw)
In-Reply-To: <ae7f936dbd1fcf19b1cd1e7b92d2dea8@brasstown.quanstro.net>

this is not a new discussion, it started in november 2009. the fact
that it's just coming to 9fans is a sign of how far behind the times
we are :(

the go runtime is ~380k. that one you must carry always even in an
empty program (see below). what you're complaining about is the
side-effect of importing fmt and other big packages such as os and
net. with fmt you're sucking in all the unicode code tables and the
reflection code used to process printing arguments (which you can't
prove will not be used). the initial jump is big, but as your code
grows the binary size tends to increase slower -- all of the imports
are already in. the biggest program from the Go distribution
frequently in use is "godoc". it deals with xml, json, binary
encoding, directory navigation, document preparation, source code
parsing, compression/decompression and serves the major website for go
-- golang.org... that program, statically linked, is 8 megs (64-bit).
i've seen things that deal with graphics which get to 20 megs. that is
reasonable, i think.

here's an illustrative progression of go binary sizes:

$ cat > t.go
package main
func main(){
}
$ go build t.go; ls -l t
-rwxr-xr-x  1 andrey  wheel  384880 Mar 23 12:43 t
$ cat > t.go
package main
func main(){
    println("hello")
}
$ go build t.go; ls -l t; ./t
-rwxr-xr-x  1 andrey  wheel  389008 Mar 23 12:43 t
hello
$ cat > t.go
package main
import "unicode"
var _ = unicode.MaxRune
func main() {
}
$ go build t.go; ls -l t
-rwxr-xr-x  1 andrey  wheel  581024 Mar 23 12:45 t
$ cat > t.go
package main
import "fmt"
var _ = fmt.Println
func main(){
}
$ go build t.go; ls -l t
-rwxr-xr-x  1 andrey  wheel  1481920 Mar 23 12:44 t



  reply	other threads:[~2013-03-23 19:13 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23  9:45 tlaronde
2013-03-23  9:53 ` Richard Miller
2013-03-23  9:56   ` Steve Simon
2013-03-23 21:34     ` tlaronde
2013-03-23 10:05   ` tlaronde
2013-03-23 10:24     ` lucio
2013-03-23 11:40       ` Peter A. Cejchan
2013-03-23 12:25         ` lucio
2013-03-23 16:06         ` Francisco J Ballesteros
2013-03-23 16:09           ` erik quanstrom
2013-03-23 16:19             ` Francisco J Ballesteros
2013-03-23 16:23               ` erik quanstrom
2013-03-23 16:39                 ` Gorka Guardiola
2013-03-23 17:15                   ` Rob Pike
2013-03-23 17:20                     ` erik quanstrom
2013-03-23 19:29                       ` Rob Pike
2013-03-23 19:31                         ` erik quanstrom
2013-03-23 19:34                           ` Rob Pike
2013-03-23 19:33                         ` Rob Pike
2013-03-23 19:39                           ` Francisco J Ballesteros
2013-03-23 19:58                             ` andrey mirtchovski
2013-03-23 20:11                               ` Francisco J Ballesteros
2013-03-24  0:44                         ` Kurt H Maier
2013-03-23 17:23                     ` hiro
2013-03-23 17:30                     ` Francisco J Ballesteros
2013-03-23 17:44                       ` hiro
2013-03-23 17:52                         ` Nemo
2013-03-23 17:31                     ` hiro
2013-03-23 17:33                     ` hiro
2013-03-23 17:37                     ` tlaronde
2013-03-23 17:55                       ` erik quanstrom
2013-03-23 19:13                         ` andrey mirtchovski [this message]
2013-03-23 19:23                           ` ron minnich
2013-03-23 19:56                             ` Gorka Guardiola
2013-03-23 23:45                               ` andrey mirtchovski
2013-03-23 23:58                                 ` Bruce Ellis
2013-03-24  8:49                                 ` Francisco J Ballesteros
2013-03-24  9:02                                   ` Steve Simon
2013-03-24  9:22                                     ` lucio
2013-03-30 19:49                                 ` ron minnich
2013-03-25 14:45                             ` Nicolas Bercher
2013-03-23 19:17                         ` Rob Pike
2013-03-23 19:19                           ` Rob Pike
2013-03-23 19:32                           ` Francisco J Ballesteros
2013-03-23 19:37                             ` Rob Pike
2013-03-23 19:43                               ` Rob Pike
2013-03-24  0:46                                 ` Kurt H Maier
2013-03-23 19:45                               ` Francisco J Ballesteros
2013-03-25  9:43                               ` [9fans] mk and transitive dependencies (was: gcc not an option for Plan9) dexen deVries
2013-03-25 10:26                                 ` Gorka Guardiola
2013-03-25 10:33                                   ` hiro
2013-03-25 10:40                                     ` Bence Fábián
2013-03-25 10:42                                       ` Gorka Guardiola
2013-03-25 11:00                                       ` dexen deVries
2013-03-25 10:40                                     ` Gorka Guardiola
2013-03-25 10:43                                     ` dexen deVries
2013-03-25 11:02                                       ` [9fans] mk and transitive dependencies (was: gcc not an option lucio
2013-03-25 11:09                                       ` [9fans] mk and transitive dependencies (was: gcc not an option for Plan9) Bence Fábián
2013-03-25 13:30                                         ` erik quanstrom
2013-03-25 11:16                                       ` tlaronde
2013-03-25 11:55                                         ` Charles Forsyth
2013-03-25 12:10                                           ` tlaronde
2013-03-25 20:37                                       ` Steve Simon
2013-03-25 13:35                                   ` erik quanstrom
2013-03-25 14:38                                     ` andrey mirtchovski
2013-03-25 17:30                                 ` Ori Bernstein
2013-03-23 23:03                           ` [9fans] gcc not an option for Plan9 David Leimbach
2013-03-23 19:29                         ` hiro
2013-03-23 17:47                     ` Gorka Guardiola
2013-03-24  0:41                     ` Kurt H Maier
2013-03-24  9:48                     ` tlaronde
2013-03-24 11:56                       ` Dustin Fechner
2013-03-24 12:03                         ` tlaronde
2013-03-23 16:20             ` Gorka Guardiola
2013-03-23 16:37             ` lucio
2013-03-25  5:48           ` Peter A. Cejchan
2013-03-25  6:27             ` lucio
2013-03-25 16:45               ` Kurt H Maier
2013-03-25 19:04                 ` lucio
2013-03-25 19:19                   ` sl
2013-03-25 19:31                     ` aram
2013-03-25 19:35                       ` sl
2013-03-26 22:01                         ` Bence Fábián
2013-03-26 22:05                           ` sl
2013-03-26 22:17                             ` Bence Fábián
2013-03-25 20:18                       ` Kurt H Maier
2013-03-26  4:45                         ` lucio
2013-03-26  6:03                           ` Kurt H Maier
2013-03-26  9:44                           ` iainws
2013-03-26 12:07                           ` sl
2013-03-26 12:11                             ` Rubén Berenguel
2013-03-26 12:16                               ` dexen deVries
2013-03-26 12:16                               ` hiro
2013-03-26 12:20                                 ` Rubén Berenguel
2013-03-26 12:57                               ` Charles Forsyth
2013-03-26 13:04                                 ` Rubén Berenguel
2013-03-26  8:28                       ` dexen deVries
2013-03-25 19:38                   ` erik quanstrom
2013-03-25 19:46                     ` lucio
2013-03-25 19:51                       ` andrey mirtchovski
2013-03-25 19:58                         ` tlaronde
2013-03-25 19:51                     ` sl
2013-03-25 20:13                     ` Kurt H Maier
2013-03-26  9:43               ` Balwinder S Dheeman
2013-03-23 17:08         ` hiro
2013-03-25  5:53           ` Peter A. Cejchan
2013-03-23  9:54 ` Peter A. Cejchan
2013-03-23 10:10   ` tlaronde
2013-03-23 10:15     ` Peter A. Cejchan
2013-03-23 12:17 ` Bakul Shah
2013-03-23 12:48   ` lucio
2013-03-25  1:00 Winston Kodogo
2013-03-25  1:20 ` Dan Cross
2013-03-25  1:24   ` andrey mirtchovski
2013-03-25  1:27     ` Lyndon Nerenberg
2013-03-25  1:36   ` Kurt H Maier
2013-03-25  1:42     ` Dan Cross
2013-03-25  1:45       ` Jacob Todd
2013-03-25  1:47         ` andrey mirtchovski
2013-03-25  1:54       ` Kurt H Maier
2013-03-25  2:02         ` Dan Cross
2013-03-25  2:08           ` Kurt H Maier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK4xykW1Mr3wMV6ECdHvfCnM6tJD-d-=nMj8cXpL3scMO8ETQA@mail.gmail.com' \
    --to=mirtchovski@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).