Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
$ ./miniruby -v MacRuby version 0.5 (ruby 1.9.0) [universal-darwin9.0, x86_64] $ ./miniruby --compile -e "p 42" $ ./a.out 42 $ file ./a.out ./a.out: Mach-O 64-bit executable x86_64 $ otool -L ./a.out ./a.out: /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 677.23.0) /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0) /usr/lib/libauto.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libxml2.2.dylib (compatibility version 9.0.0, current version 9.16.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.1.4) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 476.18.0) $ du -h ./a.out # omgwtf 13M ./a.out $ cat fib.rb def fib n if n < 3 1 else fib(n-1) + fib(n-2) end end n = ARGV.size == 1 ? ARGV.first.to_i : 35 p fib(n) $ time ./miniruby fib.rb 40 102334155 real 0m3.911s user 0m3.834s sys 0m0.050s $ ./miniruby --compile fib.rb $ time ./a.out 40 102334155 real 0m2.959s user 0m2.900s sys 0m0.038s $ cat fib.c #include <stdio.h> static int fib(int n) { if (n < 3) { return 1; } else { return fib(n - 1) + fib(n - 2); } } int main(int argc, char **argv) { const int n = argc > 1 ? atoi(argv[1]) : 37; printf("%d\n", fib(n)); return 0; } $ gcc fib.c -o fib -arch x86_64 $ time ./fib 40 102334155 real 0m1.755s user 0m1.732s sys 0m0.011s $ gcc fib.c -o fib -arch x86_64 -O3 $ time ./fib 40 102334155 real 0m0.491s user 0m0.482s sys 0m0.004s $ cat ocfib.m #import <Foundation/Foundation.h> @interface Fib : NSObject @end @implementation Fib - (int)fib:(int)n { if (n < 3) { return 1; } else { return [self fib:n - 1] + [self fib:n - 2]; } } @end int main(int argc, char **argv) { const int n = argc > 1 ? atoi(argv[1]) : 37; Fib *o = [Fib new]; printf("%d\n", [o fib:n]); return 0; } $ gcc ocfib.m -o ocfib -framework Foundation -fobjc-gc -arch x86_64 $ time ./ocfib 40 102334155 real 0m3.186s user 0m3.147s sys 0m0.017s
This paste will be private.
From the Design Piracy series on my blog: