Live data from Hacker News

A raytracer in 7 lines of 'K'

nsl.com

1–10 of 41 posts

Re: A raytracer in 7 lines of 'K'

#4
post #2

Voted up in hope that someone can adequately explain that piece of code frighteningly close to line-noise.

Be happy it is not APL, where if you need two lines to express your problem you'll be scolded because you programmed it before you properly understood it ;)

Re: A raytracer in 7 lines of 'K'

#5
post #2

Voted up in hope that someone can adequately explain that piece of code frighteningly close to line-noise.

frighteningly close to line-noise

That's everyone's initial reaction (it was mine too). But my experience has been that if you suspend initial disbelief and approach the language on its own terms, the result is jaw-dropping awe.

http://news.ycombinator.com/item?id=266167

Re: A raytracer in 7 lines of 'K'

#6
post #3

As far as readability goes, this might have as well been written in machine language.

Except that a machine language program would be thousands if not millions of times as long.

Readability is relative. Java is unreadable to my grandmother. Turkish is unreadable to me. In other words, the opinion of someone who hasn't learned a language regarding its readability is irrelevant.

It is true that the way you read a language like this is different from the way you read Java. You don't expect to grok a line of code atomically, then move to the next line. It's more like reading math: you work with each line, understanding what makes it tick. No doubt that doesn't appeal to everyone. But the APL/K/J people do amazing things.

The ultimate answer as to whether or not this is just line noise? http://kx.com/Customers/end-user-customers.php

Re: A raytracer in 7 lines of 'K'

#8
post #6
post #3

As far as readability goes, this might have as well been written in machine language.

Except that a machine language program would be thousands if not millions of times as long. Readability is relative. Java is unreadable to my grandmother. Turkish is unreadable to me. In other words, the opinion of someone who hasn't learned a language regarding its readability is irrelevant. It is true that the way you read a language like this is different from the way you read Java. You don't expect to grok a line…

> Readability is relative. Java is unreadable to my grandmother. Turkish is unreadable to me. In other words, the opinion of someone who hasn't learned a language regarding its readability is irrelevant.

What a gem!

I should start a collection of those, every now and then you get these things you can just frame and look at three times a day here.

Re: A raytracer in 7 lines of 'K'

#10
OK, this is a mess. Lets try to get some new coolness metrics here.

A. Number of lines of assembler it compiles to

B. Time it took you to write it (no cheating)

C. Number of symbols used (with names being one symbol)

Post reply on HN