Live data from Hacker News

Impending kOS

archive.vector.org.uk

211–220 of 242 posts

Re: Impending kOS

#211
post #141
post #140

Earlier quoted context omitted.

> When speaking, english usually has more syllables per unit time than mandarin, so english has the highest spoken information density of any language. Of the seven languages in the study, using 20 specific short texts, that were originally written in English then translated (well?) in other languages.

They recognized this issue and accounted for it. From the paper: Since the texts were not explicitly designed for detailed cross-language comparison, they exhibit a rather large variation in length. For instance, the lengths of the 20 English texts range from 62 to 104 syllables. To deal with this variation, each text was matched with its translation in an eighth language, Vietnamese (VI), different from the seven la…

That just deals with the variation in length of the texts, not the effect of translation quality or other possible problems with the experiment, like written -> spoken conversion.

Re: Impending kOS

#213
post #166
post #148

Earlier quoted context omitted.

I think part of the difficulty here is that it's almost like Haskell's point free style, but not quite. It isn't really clear where the arguments to avg go. It seems that it's meant to be a bit like this: avg list -> (sumall list) / (tally list) I guess you just need to know how the argument you give to avg when you use it distributes over the functions that comprise the expression. The list argument to tally isn't a…

In J there are two special ways to combine functions which are written using special syntax. Namely, 1) when you want to calculate f(y, g(y)) , you write (f g) y - this is "hook" of one argument (monadic, in J terms) 2) when you want to calculate f(x, g(y)) , you write x (f g) y - this is "hook" of two arguments (dyadic) 3) when you want to calculate f(g(y), h(y)) , you write (g f h) y - this is monadic "fork" 4) whe…

That takes some time to digest, but I guess is absolutely crucial to be able to do anything with this language.

Would you say that this is 90% of the reason it looks so uncomprehensible?

Re: Impending kOS

#214
I hate to love KDB because its a very expensive closed platform. But if you understand some of the concepts and how easy it is to achieve those concepts with a few lines of q code you can do some brilliant things. Yes, KDB is a great data store and provides very quick methods for crunching that data with its vector-based approach.

However, whats really impressed me with KDB is that you can do so much more with it. In some banks it has effectively become the messaging middleware for connecting hundreds of disparate data sources. In addition to passing messages you get the data storage and analytics tools for free...

Re: Impending kOS

#215
post #214

I hate to love KDB because its a very expensive closed platform. But if you understand some of the concepts and how easy it is to achieve those concepts with a few lines of q code you can do some brilliant things. Yes, KDB is a great data store and provides very quick methods for crunching that data with its vector-based approach. However, whats really impressed me with KDB is that you can do so much more with it. In…

Very true. But remember recently they released a completely free version of it. Downloads can be obtained from kx.com.

Re: Impending kOS

#216
post #209
post #105

Earlier quoted context omitted.

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

> Doing this generally in Ruby I think is impossible

Not so much. At least with views over most Enumerables, its quite possible in Ruby -- that's the whole reason that Enumerable::Lazy exists.

The existing File class doesn't quite support it because of the way its iterators are implemented (particularly, they are one way) but the class is easily extended to allow it, e.g.:

  class RewindFile 
Then you can create a synced view that has the character positions of the newlines in a file like this:

  a = RewindFile.new "myfile.txt"
  c = a.lazy.each
            .with_index
            .find_all {|x,_| x=="\n"}
            .map {|_,y| y}

Re: Impending kOS

#217
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…

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…

And now with less snark :).

K/Q/kdb+ deploys a single executable and some additional k code (Q is written in k) in with no changes.

Re: Impending kOS

#218
post #166

Earlier quoted context omitted.

In J there are two special ways to combine functions which are written using special syntax. Namely, 1) when you want to calculate f(y, g(y)) , you write (f g) y - this is "hook" of one argument (monadic, in J terms) 2) when you want to calculate f(x, g(y)) , you write x (f g) y - this is "hook" of two arguments (dyadic) 3) when you want to calculate f(g(y), h(y)) , you write (g f h) y - this is monadic "fork" 4) whe…

That takes some time to digest, but I guess is absolutely crucial to be able to do anything with this language. Would you say that this is 90% of the reason it looks so uncomprehensible?

No, it's not absolutely critical. You can do a lot of your own programming without using hooks and forks. Your programs will be somewhat simpler - and whenever you need to use a variable in several places, you'll have to explicitly name it - but still.

Incomprehensibility happens in part because all ASCII characters are used - so you have a lot of differently-looking symbols; because [ and { aren't paired with ] and }, and " isn't paired either; because you often have . and : as the second character of built-in entities, so you've got a lot of dots... APL used the symbols invented explicitly for those purposes, but the price - non-ASCII alphabet - was considered too high. So - no, I wouldn't say forks and hooks are the source of 90% of uncomprehensibility.

Re: Impending kOS

#219
post #36

k/q really doesn't have to be this unreadable, that's just Arthurs style. Here's some code in C by him for comparison: http://kx.com/q/cs107/a.c

I tried cleaning it up a bit: https://gist.github.com/lukechampine/f54fce8fd756254cefb2 But the actual meaning of the program is still lost on me. I can only guess it has something to do with parsing files (note the checks for curly braces). Feeding it its own source code produces some output, but I have no idea what it actually modified.

In case anybody is still interested, it's now up on http://kparc.com/cs107/readme

Re: Impending kOS

#220

Does a good formal introduction exist for K, or Q, or APL, or J, or any other languages in this family? Something with, you know, a syntax definition at least, and any kind of formal definition of the semantics. The closest I could find is this [1] but "The model is expressed in SHARP APL", so from the start, it's circular. [1] http://www.jsoftware.com/papers/APLSyntaxSemantics.htm

For J, IMO, jsoftware.com has good resources. That includes vocabulary (the way to specify the language), a few textbooks (JforC, J Primer), essays, examples of short code... And J forums are pretty helpful.

Coming back to the question, for J its vocabulary on jsoftware.com is a good resource.

Post reply on HN