3 ms·
> But it's an external database with its code and its optimizations. You're completely mistaken. It's not an "external database". That's a regular, ~600kb inte
by geocar 7y ago
> But it's an external database with its code and its optimizations.
You're completely mistaken. It's not an "external database". That's a regular, ~600kb interpreter download from kx.com
Those lines are all the lines typed into a q) prompt one at a time on my laptop (A 1.6ghz macbook air).
> In this case it seemed that it was just doing a binary search,
Yes. That's all okon does as well, they just do it over a B-tree instead of a contiguous list. If you read the writeup you'll see the author actually eschewed using a contiguous list for reasons of random insertion then took to a B-tree generation algorithm that couldn't handle unsorted input. I suppose they just forgot what they were doing at some point.
> but it was using an already sorted dataset that the OP of that comment wasn't using.
Again, you're mistaken. The author (Stryku) might not have known the sorted file existed, but the first thing they tried to do was sort it. They just had a problem sorting a 22GB file because they were using terrible tools. They had to make tools because they didn't have any good ones. The rest of their algorithm took advantage of the fact the input (to these later stages) was sorted.
> Well, I can't get anything out of this.
> I can't honestly believe anyone that says that's a good way to create code.
I spent 5 minutes to write something (in q) someone else wrote over twenty days (in C++).
I can't honestly believe anyone that thinks spending twenty days on a problem is better than five minutes.
If you can't get there, it's going to be really hard to talk about what's amazing in k!
- gjulianm 7y ago> I can't honestly believe anyone that thinks spending twenty days on a problem is better than five minutes. Nobody thinks that and I didn't say that. I was talking about that specific file (although the rest of them are equally unapproachable). > If you can't get there, it's going to be really hard to talk about what's amazing in k! Well, the thing is that at this point the only amazing things that have been talked about is that it's fast (in some specific use cases of data queries) and extremely concise. What more there is to K? What more reasons are there to use it, and with which downsides does it come with?
- geocar 7y ago> Nobody thinks that and I didn't say that. I was talking about that specific file I hope nobody thinks that, but unless you can come to terms with the fact that you're wrong, and that this is a completely fair comparison, you're going to be the guy who writes okon2 at some point instead of using a better tool. > the only amazing things that have been talked about is that it's fast (in some specific use cases of data queries) Those weasel words are preventing you from seeing what should be obvious: The k program is faster, shorter, obviously correct, and it took less time to write. That's the amazing thing. Who doesn't want that? > What more reasons are there to use it? This is the wrong way to think about things, because there's an infinity of such reasons. Instead, invert it: You should always use the best tool you can. If you don't know k, it can never be used even if it would otherwise be the best tool. I don't recommend people use k (except when it works), but I recommend people learn k because it'll make them better programmers. > which downsides does it come with? The biggest downside is that you don't know it, and the only person who can fix that is you