I'll give this a shot. I'll try to explain what's in my mind as I read it as well.

First, get out the reference manual: http://kparc.com/k.txt and we'll do the first couple lines.

The sequence that goes f x applies x to f. this f is unary.

The sequence that goes x f y applies x and y to f. this f is binary (and just labelled verb).

Some things (adverbs) go f a x and apply f in some special way to x.

Last hint: You read this code from left to right (like english). Do not scan it.

Now let's dive in:

c::a$"\n"

This says: c is a view of where a is a newline. That is, if "a" contains a file, then c is the offsets of each newline.

A view is a concept in k that is unusual in other languages: When "a" gets updated, then "c" will automatically contain the new values. This is similar to how a cell in Excel can refer to other cells and reflect whatever the value of those cells happens to be.

b::0,1+c

This says: b is a view of zero join one plus c. That is, where "c" contains the offsets of each newline, 1+c would contain the beginning of each new line. We joint zero to the beginning because of course, the beginning of the file is also the beginning of a line.

d::(#c),|/-':b

This says: d is the view of the (count of c) joined with the max reduce, of each pairs difference of b. That sounds like a lot, but "each pairs difference of b" (where b is the position of all the new lines) is also the length of each line, and the max reduce of that is the longest line. You might say that "d" is the dimensions of the file.

i::x,j-b x:b'j

This says: i is a view of x (?) joined with j (?) minus b (the offset of the beginning of each line) applied to each x which is defined as the bin of j in b.

j hasn't been defined yet, but you can see that x is defined later in the definition, and used to the left. This is because K (like APL) executes from right to left just like other programming languages. you write a(b(c(d()))) in C and you're executing the rightmost code first (d) then applying that leftwards. We can do this with anything including definitions.

The other string thing is that we know that b is the offset of the beginning of each line, and yet we're applying something to it. This is because k does not distinguish between function application and array indexing. Think of all the times you write in JavaScript x.map(function(a) {return a[whatever] }) when you'd really just like to write x[whatever] -- k let's you do this. It's a very powerful concept.

On that subject of binning: b'j is going to find the index of the value of b that is smaller or equal to j. Since we remember that b is the offset of the beginning of each line, then if j is an offset in the file, then this will tell us which line it is on(!)

But we don't understand what j is yet; it's the next definition:

j::*|k

This says: j is a view of the last (first reverse) of k. We don't know what k is yet.

f:""

This says: f is defined as an empty string.

g::a$f

This says: g is a view of the offsets of f (an empty string) in a. Initially this will be null, but other code will assign to f later making g a value.

Next line.

s::i&s|i-w-2

This is very straightforward; & is and, and | is or. While excel doesn't let us use a cell in it's own definition, k does: It means the old value of s. So this is literally: the new view of s is i and the old view of s or i minus w (?) minus 2.

We don't know what w is yet.

S:{s::0|x&d-w}

This is a function (lambda). x is the first argument. If we called S[5] it would be the same as setting s to zero or 5 and d (dimensions) minus w. Double-colon changes meaning here; it no longer means view, but set-global.

px:{S s+w*x}

This requires some knowledge of g/z: http://kparc.com/z.txt

Note that px is defining a callback for when the pageup/pagedown routines are called. x will be 1 if we page down and -1 if we page up. It may now become clear that S is a setter of s that checks it somehow. When we understand what w is (later in the program) it will be absolutely clear, but pageup/pagedown are changing s by negative w when pageup, and positive w when pagedown.

wx:{S s+4*x}

Consulting the g/z documentation, we can see this has to do with wheels. Note we modify s again relative to 4 times x; x is -1 when wheelup and 1 when wheeldown. It becomes clear that s is modified by the pageup/pagedown and the mouse wheel.

cc:{9'*k_a}

Again: in the documentation, 9' stashes something in the clipboard. cc is a function that takes the first slice of offsets k (we still don't understand) in a (the file). The g/z documentation says that cc is the callback for control-C. This is expected as control-C traditionally copies things to the clipboard. Since the slice of offsets k in a are being saved in the clipboard, we may guess at this point that k will contain the current selection.

This process is time consuming, but it is to be expected: Learning english took a while at first, and often required consulting various dictionaries. Eventually you got better at it and could read somewhat quickly.

I don't know if you want to try the next few lines yourself to see if you can get a feel for it, or if you want to try one of the less dense examples:

* http://www.kparc.com/$/view.k
* http://www.kparc.com/$/edit.k

... or if you want me to keep going like this, or if you want to ask a few questions. What are your thoughts?