3 ms·
Personally, the way I want to write that program involves destructuring. All the cons, car and cdr crap makes my eyes glaze over almost as bad as the js. More
by andrewflnr 13y ago
Personally, the way I want to write that program involves destructuring. All the cons, car and cdr crap makes my eyes glaze over almost as bad as the js.
More on topic, it seems like at least in the example given, inlining of functions followed by standard optimization would give good results, and I thought we were pretty decent at inlining. Is that just because the example is so simple, and the point is that that ability needs to be more general?
- cwp 13y agoWell, inlining plus subsequent optimization is exactly what he's talking about. He calls it "specialization." As soon as you start to do that really aggressively, you run into all the issues he brings up.
- agumonkey 13y agoI don't know if the author stopped at that level on purpose. That's basic SICP abstraction layer. And I believe types and then pattern matching was another abstraction on top of that to get literal symmetry, but to my eyes at this point it's two faces of the same coin.
- Tyr42 13y agoI agree. I really like Racket because of the powerful match function, which can do more than Haskell, for comparison. It's like very powerful ViewPatterns.