Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why is Scheme\Racket so slow?

Name: Anonymous 2015-05-02 21:29

You and the Sussman go on and on about how powerful and expressive it is, but the only expression I'm making is that of exasperation as I wait a full thirty fucking seconds for this piece of shit language to draw a single 1000*1000 monochrome image onto the screen.

#lang racket
;; 5/2/2015
(require graphics)
(open-graphics)
(define vert 1000) (define horiz 1000) (define rule 30) (define viewport (open-viewport "LOL" horiz vert))
(define (auto seed row)
(if (> row vert) #t
(and ((lambda (src yv)
(let ([draw-pixel (lambda (x y) ((draw-pixel viewport) (make-posn x y)))]
[c (lambda (fun l x) (fun fun l x))])
(c (lambda (fun l x)
(if (empty? l) #t (and (if (= 1 (car l)) (draw-pixel x yv) 0) (fun fun (cdr l) (+ x 1)) ))) src 0))) seed row)
(auto ((lambda (old)
(let ([gen (lambda (x y z) (let ([a (if (= x 0) 0 4)] [b (if (= y 0) 0 2)] [c (if (= z 0) 0 1)])
(if (bitwise-bit-set? rule (bitwise-ior a b c)) 1 0)))]
[r (lambda (m) (if (null? m) '() (append (cdr m) (cons (car m) '()))))])
(map gen old (r old) (r (r old))))) seed) (+ row 1)))))

(auto ((lambda (width pixels)
(let ([c (lambda (fun init end) (fun fun init end))])
(c (lambda (fun init end)
(if (= init end) '() (cons (if (memq init pixels) 1 0) (fun fun (+ init 1) end)))) 0 width))) horiz (cons (/ horiz 2) '())) 0)

(close-viewport viewport)
(close-graphics)

Name: Anonymous 2015-05-03 0:09

cache misses and page faults and garbage collection pauses

how to sound like you're an expert when you actually have no idea what you're talking about

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List