Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Compiling stb_image, an incredibly useful image loader:

  $ wc -l stb_image.h
      6433 stb_image.h

  $ more stb_image.c 
  #define STBI_ONLY_JPEG
  #define STBI_ONLY_PNG
  #define STBI_FAILURE_USERMSG
  #define STB_IMAGE_IMPLEMENTATION
  #include "stb_image.h"

  $ time clang -c stb_image.c -o stb_image.o

  real	0m0.091s
  user	0m0.075s
  sys	0m0.014s
Seems pretty fast to me!


Have you ever written Pascal, Go, or D? That's what fast compilation looks like. The D standard library compiles in 3.5s from scratch.


Yes, I've used Go. The compiler is fast and that's really nice; fast compilation was one of their explicit goals.

Pascal and C are fast because they're old and relatively simple, and their implementations are mature.

C++ becomes super slow when you start doing anything interesting, when I tried Rust it seemed very slow, even Java is slow although it seems like it shouldn't have to be. Those languages are all more widely used than D, I think.

[edit: typo]




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: