Live data from Hacker News

Impending kOS

archive.vector.org.uk

201–210 of 242 posts

Re: Impending kOS

#202
post #126
post #37

Earlier quoted context omitted.

If someone produces smaller and faster code than me, then I should want to learn from it. I wonder why other people have the exact opposite reaction. Why do you think that is?

I do enjoy learning about such things, but, for most of the work I do, performance is nowhere near at the top of the list of things I care about. Also in the past I've been burned by code that's small/fast but is otherwise utterly unmaintainable. I'm not saying that's the case here, but... past experience, and all that tends to color perceptions. I think with a language like k or q, which appears to be purpose-built…

> I think with a language like k or q, which appears to be purpose-built for certain types of problems,

The thing is, it's not purpose built, and it doesn't even appear to be if you suspend your disbelief. The only reason you'd think it is purpose built is because "well, it can't be this short if it wasn't purpose built". But if you go over the manual, and find special built operators, please tell us what they are.

e.g., to compute an average, you can use the function avg:{(+/x)%#x} - with the exception of parentheses, every character has an orthogonal function. Similarly, the maximum subarray sum solution mss:|/0(0|+)\ ; and there are many others. And it's not just math stuff - http://nsl.com has lots of other examples of many kinds -- and most importantly -- is an operating system + GUI not general enough?

Re: Impending kOS

#203
post #37
post #31

Earlier quoted context omitted.

Yes, the research literature on software development has consistently found that code size is the best measurement of complexity and predictor of error rates. (Sorry I don't have citations handy but we've discussed this many times on HN, and there's a recent study in the book "Making Software" that adds to it.) What's interesting is how strongly this goes against what most people think they know about good programmin…

If someone produces smaller and faster code than me, then I should want to learn from it. I wonder why other people have the exact opposite reaction. Why do you think that is?

Hey, just read bytecode, then. As small and fast as you can get.

Re: Impending kOS

#204

Earlier quoted context omitted.

It's a solution to CS107 assignment 1 : http://web.stanford.edu/class/cs107/assign1.html

Guess I could have just looked at the URL, huh. Well, it was fun trying to reverse Whitney's code anyhow. Humorously, it looks like this code would have received a poor grade. It meets just about every standard for low quality outlined here: http://web.stanford.edu/class/cs107/landmarks.html , particularly "Fast code which doesn't work quite right." (Due to an off-by-one error, this code fails to properly reconstruct…

> Due to an off-by-one error, this code fails to properly reconstruct the example text

What's your example? It seems to work fine to me on "{all is well}{ell that en}{hat end}{t ends well}"

Re: Impending kOS

#205
post #159

Earlier quoted context omitted.

Wow, that was fascinating. K looks utterly mind-expanding, thanks for breaking this down. You obviously have some experience working with K, and it sounds like at least Javascript, too? K is so foreign I expect it has a lot of interesting thoughts locked up in there that maybe don't get the attention they deserve. Would you say there are any "killer features" of the language / environment that you miss when working w…

Killer feature -------------- Not having to write: for(int i=0; i which generally obscures the fact that I'm trying to do a map or fold (e.g. - reduce) operation :).

[deleted]

Re: Impending kOS

#206
post #99
post #93

Earlier quoted context omitted.

It almost sounds like kdb needs an alternative syntax that is more human readable.

It has one: q. But once you get over the syntax, you realize that you also need to grok different semantics that you are used to. Some q is readable english - e.g., an expression like sum price where size>3 is (to the uninitiated) more readable than the equivalent k +/price@&size>3 but that only works for simple stuff. The (idiomatic!) computation of maximum-subarray-sum[0] |/0(0|+)\ becomes max over 0 (0 max +) scan…

I would find something like

over(max, scan(0, max(+, 0))

slightly more readable, even if that still gives me a higher-order-headache.

Because, y'know, it's confusing to have symbol salad with a weird mixture of infix and postfix operators, even more so if you have type raising (or the moral equivalent thereof) thrown in for good measure.

Re: Impending kOS

#208
The APL family was developed to think about math and linear algebra in particular. Iverson's "Notation as a tool of thought" f'rinstance: http://www.jsoftware.com/papers/tot.htm

If you've worked with such things for your day job, exposure to an APL language is mind blowing in the same way as exposure to Lisp is. You'll rapidly find out that an awful lot of the numerics world is an ad-hoc reinvention of an APL language. Leading thinkers in the numerics world have noticed. Have a look at the Tensor type inside Torch7, or -idx- class in Lush (the same thing): they are, in fact, a sort of APL with a more conventional, aka painfully wordy, notation.

Writing an editor in an array language seems crazy, but then, writing a parallel processing system in a language that was designed to run applications in your web browser also seems crazy. If people had stuck with APL style languages, well, databases, particularly distributed databases (Kx and 1010, both K based systems, scale to Pentascale, and have for a long time), would suck less, as would CUDA programming. Their revival could make life easier in these problem domains.

Re: Impending kOS

#209
post #105
post #87

Earlier quoted context omitted.

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 re…

That was awesome, thanks for explaining that for us. It makes a lot of sense the way you explain it, and I quickly got the idea that you can make some powerful expressions this way. The smooth creation of lists is I think one of the most important language features higher level languages have over lower level languages like C. Just this thing: c::a$"\n" That's all I needed to be convinced that modern languages should…

The view automatically gets updated whenever a gets updated. Every time you change a (directly or indirectly), then c will automatically get updated.

Doing this generally in Ruby I think is impossible, but you might be able to get close if all your objects are based on ActiveModel::Dirty

Re: Impending kOS

#210
post #49
post #18

>Kdb+ has sharp elbows. No shit. I used to work as a quant, and while I was an okay quant and mediocre trader at best, I survived for three years in the industry because of my kdb+ proficiency: the firm I was at spent a couple of million dollars on kdb+ only to find out that most people could not wrap their heads around kdb+ let alone debug it effectively. My (former) colleagues were definitely smart people. In many…

I've worked in many shops that use kdb+ and the ones who really benefit are the ones who bothered to get some training on it rather than those who just assume they'll wing it somehow. Kx themselves have been running great intro workshops for a couple of years now. Some guys at the next desk attended one and came back buzzing with excitement at how they now saw through the noise. So the take away is - if you didn't bo…

I initially read that as:

> ... came back buzzing with excrement

Post reply on HN