3 ms·
I worked at a K shop last summer, and when I was learning the language, I tried using sensible variable names. I was told in no uncertain terms that, when you w
by personamb 17y ago
I worked at a K shop last summer, and when I was learning the language, I tried using sensible variable names. I was told in no uncertain terms that, when you write K, local variables should be one letter, globals should be two, and functions should be three.
It sounds like a total disaster, but after about two weeks (which is a long-ass time to learn a language), everything made perfect sense, and I really enjoyed using it for the rest of the time. It's very powerful and fast to execute, and after you get the hang of it, it's fast to write, too.
- jasonwatkinspdx 17y agoI haven't spent enough time with K to get to that point of naturalness. I do think a k like language that used slightly more natural nemonics could have much broader appeal with minimal impact on code length. IMHO what makes k (and j for that matter) concise is the primitives, how they combine naturally, and how iteration is subsumed to avoid any form "item at a time" code. That last bit is what separates it from the common map/fold idioms in other languages. Example: http://www.nsl.com/papers/kisntlisp.htm http://www.nsl.com/papers/kisntlisp.htm
- gruseom 17y agoDo tell us more about your experience. I'm fascinated with this stuff from afar. Also, I'm curious how their database stacks up: what's it better/worse at? It seems like magic for a program so small to do so much so well. I'd like to know what the tradeoffs are. (Either that or move to their universe.)
- personamb 17y agoSorta forgot about this thread, but hopefully ou see this. K is super-great at vector operations; element-wise addition between two lists of equal length, for example; more powerfully, mapping lists to functions. The DB stuff we were doing were columnar databases, so it was incredibly fast at doing data analysis and correlations. Not so fast at adding single rows, but if you wanted to take a list of transactions and compare things day-over-day, or do sophisticated statistical operations, you simply had to write a line or two, and watch it take multiple million-element lists and give you an answer in milliseconds. I'm still pretty convinced it was voodoo magic. When I used it, there was a pretty hefty license fee, but there's a trial version which limits the amount of memory it will use, but can still do quite a bit to give you a sense of the speed (as long as you're doing it right). Remember, no stinkin' loops!
- gruseom 17y agoI'm still pretty convinced it was voodoo magic. I was kind of afraid you would say that. I wish they'd open-source it. It's such a pity that Peter Seibel didn't include Arthur Whitney in Coders at Work. I suggested him, IIRC, but he didn't get in. As far as I'm concerned he belongs in the top echelon. Here is what Roger Hui, the J guy and no slouch, said (I love this story): Someone once asked Peggy Lee who she thought was the best jazz singer. Her answer was, You mean besides Ella? Likewise, the answer to the question Who's the best programmer? is Besides Arthur? Edit: maybe if I'd included that in my suggestion to Seibel it would have helped :)