Post AW0gI0caTWG8gWahiC by louis@emacs.ch
 (DIR) More posts by louis@emacs.ch
 (DIR) Post #AW0UJIUyILFeyAsPmC by wilfredh@mastodon.social
       2023-05-25T06:21:20Z
       
       3 likes, 6 repeats
       
       Fitting a respectable C compiler into a 512 *byte* binary! https://xorvoid.com/sectorc.html
       
 (DIR) Post #AW0fKCA0RcAV66hWMa by louis@emacs.ch
       2023-05-25T09:53:00Z
       
       0 likes, 0 repeats
       
       @wilfredh How is this possible? Even my #golang "Hello, World" program is 7 MB big! 😀
       
 (DIR) Post #AW0fZJcQzoeoZcCxGK by ainmosni@berlin.social
       2023-05-25T09:55:43Z
       
       0 likes, 0 repeats
       
       @louis @wilfredh Well, go embeds its entire VM in the binary afaik. That's probably 6.9MiB of that binary. :P
       
 (DIR) Post #AW0gI0caTWG8gWahiC by louis@emacs.ch
       2023-05-25T10:03:48Z
       
       0 likes, 0 repeats
       
       @ainmosni I knew there was something wrong with Go all along! 😀 @wilfredh
       
 (DIR) Post #AW0i1APB2vHU0vPoEC by klausman@mas.to
       2023-05-25T10:23:11Z
       
       0 likes, 0 repeats
       
       @louis @wilfredh It's a self-contained binary (no shlibs), plus by default it contains all debug information. Using strip(1) can remove debug info. There also are Go build flags that have the same effect: `go build -ldflags "-w" `
       
 (DIR) Post #AW0i69YPdbGqp3731U by Crocmagnon@fosstodon.org
       2023-05-25T10:24:04Z
       
       0 likes, 0 repeats
       
       @louis @ainmosni @wilfredh FWIW you can reduce your go binary size using some build flags. But you’ll never get as small as C
       
 (DIR) Post #AW0taxLMBY83QOteL2 by tymwol@bayes.club
       2023-05-25T12:32:54Z
       
       0 likes, 0 repeats
       
       @louis @wilfredh What happens when you use compiler flags? When I was playing around with building a Lisp interpreter in Rust, with proper compiler flags the binary was in kb rather than mb. https://stackoverflow.com/questions/3861634/how-to-reduce-go-compiled-file-size