Hacker News new | ask | show | jobs
by dats 6522 days ago
Last year someone benchmarked a simplified raytracer in a few different languages--primarily to show off OCaml. Later, someone wrote the raytracer in 7 lines of K. http://www.nsl.com/k/ray/ray.k. The original comparison: http://www.ffconsultancy.com/languages/ray_tracer/index.html
1 comments

Nifty reference, thanks. You absolutely have to read the description in the original page though. The K looks pretty much line line noise; I've seen raw sendmail scripts that look cleaner. As terse as the language might be, a little whitespace and naming conventions might still be a good idea for us newbies...
a little whitespace and naming conventions might still be a good idea for us newbies

The culture around K is fanatical about concision. This goes back to APL, though the K people (following the lead of Arthur Whitney, the designer of K and Q) take it further than anybody else. To the unfamiliar, K looks like a bad joke (check out the 40 lines of code at http://www.nsl.com/k/s/s.k, which implement the spreadsheet at http://www.nsl.com/papers/spreadsheet.htm), but these people know what they're doing. Whitney's product includes the language interpreter, a massively scalable RDBMS, a web server, and God knows what else, and the last time I downloaded it, the total size was 380 KB. My experience with that stuff was that the more I looked at it, the more in awe I became. It's a shame it's not more widely available.