1. If you are using a database then it's not an argument for the language, I think.
The database is a piece of the language, though, and the language ships with it. Python has a lot of very complex things in its standard library; C without a standard library is foreign to most programmers. Why do they get a pass while k doesn't?
It can work better for you, yes, but it's very possible that it's just that you're used to it and you don't notice the extra burden of dealing with that code.
It's not like 'geocar is foreign to writing in other languages. His GitHub (github.com/geocar) is full of projects in other languages, some fairly recent. This may make sense as an accusation for someone who doesn't write any other code, but I don't think it's a fair accusation here.
If there was some intense burden from writing k in comparison to ALGOL-like languages, would 'geocar have written an operating system in it rather than C? That doesn't seem apparent to me.
When we are discussing languages, they don't get a pass. Python has a great math library with Numpy, but it doesn't mean that the language itself is optimal for math-related problems. And specifically in that example, using an external database when defending the speed of the language... meh. It's as if I said that Python is very fast and showed a Numpy calculation.
> This may make sense as an accusation for someone who doesn't write any other code, but I don't think it's a fair accusation here.
It's not about writing or not other languages. It's about being so used to something that you don't notice the burden. I am very familiar with some of the projects and languages I work in and I feel comfortable with the codebase, and I get used to the mental burden of working with them and I end up not noticing it. It doesn't mean it is not there.
> would 'geocar have written an operating system in it rather than C?
Has he? Couldn't find anything (I'd like to see it, honestly, seems a fun experiment).
But it's an external database with its code and its optimizations. In this case it seemed that it was just doing a binary search, but it was using an already sorted dataset that the OP of that comment wasn't using.
> kparc.com/$/
Well, I can't get anything out of this. See http://kparc.com/$/file.k. The language is cryptic and the variable names are even more cryptic. It's really hard to see what does this code even do. I can't honestly believe anyone that says that's a good way to create code.
> 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!
> 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?
> 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
But it's an external database with its code and its optimizations. In this case it seemed that it was just doing a binary search, but it was using an already sorted dataset that the OP of that comment wasn't using.
I again point to the C standard library. Modern standard-compliant C can do almost nothing without it. I don't even think it can handle IO without it.
The language is cryptic and the variable names are even more cryptic.
You're thinking of it in a light that doesn't help you understand; don't think of it as a variable, think of it as a definition. "jk is defined as..."
> You're thinking of it in a light that doesn't help you understand; don't think of it as a variable, think of it as a definition. "jk is defined as..."
I was just trying to read the code for "file" and see if I understood a little bit of the implementation they did. In this case I don't even know where even is the function that opens a file or writes to a file. I don't think that's good code and I don't believe that thinking of it in terms of a definition is going to help.
The database is a piece of the language, though, and the language ships with it. Python has a lot of very complex things in its standard library; C without a standard library is foreign to most programmers. Why do they get a pass while k doesn't?
It can work better for you, yes, but it's very possible that it's just that you're used to it and you don't notice the extra burden of dealing with that code.
It's not like 'geocar is foreign to writing in other languages. His GitHub (github.com/geocar) is full of projects in other languages, some fairly recent. This may make sense as an accusation for someone who doesn't write any other code, but I don't think it's a fair accusation here.
If there was some intense burden from writing k in comparison to ALGOL-like languages, would 'geocar have written an operating system in it rather than C? That doesn't seem apparent to me.