6 ms·
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 o
by dats 18y 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 http://www.nsl.com/k/ray/ray.k. The original comparison: http://www.ffconsultancy.com/languages/ray_tracer/index.html http://www.ffconsultancy.com/languages/ray_tracer/index.html
- ajross 18y agoNifty 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...
- gruseom 18y agoa 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 http://www.nsl.com/k/s/s.k, which implement the spreadsheet at http://www.nsl.com/papers/spreadsheet.htm 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.