title: Efficient random number list sum in Racket
body: <p>What would be the most efficient way to first generate and then sum a list of random integers in Racket?</p>
  
  <p>I am trying to implement an equivalent of the code in <a href="https://scottlocklin.wordpress.com/2011/11/30/only-fast-languages-are-interesting" rel="nofollow">https://scottlocklin.wordpress.com/2011/11/30/only-fast-languages-are-interesting</a> but I can only come up with slow imlpementations.</p>
  
  <p>My first naive attempt (not random integers, but anyway):</p>
  
  <pre><code>(define (sum-list l)
    (if (null? l)
        0
        (+ (first l) (sum-list (rest l)))))
  
  (define avector 
      (build-vector 3000000 add1))
  
  (time (sum-list avector))
  </code></pre>
  
  <p>Please note that the efficient part of the code should only be the actual sum of the list, not the generation.</p>
  
  <p>Thanks a lot.</p>