Live data from Hacker News

Stages of denial in encountering K

nsl.com

401–410 of 432 posts

Re: Stages of denial in encountering K

#401
post #161

Earlier quoted context omitted.

x: 10?A:"abcdefghijklmnopqrstuvwxyz" x "ysyselacwl" +`x`y`z!(x; So <x gives a sort index, <<x tells you how far each element is from the minimum in that sort index

I still don’t understand what the numbers in column y mean. I understand column z and that’s also what grade up is returning in John Earnest’s oK: x:“baced“ That is, for example, when sorting, the item at position 1 in the original string (“a”) moves to position 0 (the beginning of the sorted string). So in the end you get “abcde”. What does column y mean? If I sort the original with it, I get “wllaysysce”. Has this…

Nevermind. I've figured it out with the help of the reference manual at http://www.nsl.com/k/k2/k295/kreflite.pdf. I knew it was a permutation but I applied it incorrectly.

Re: Stages of denial in encountering K

#402
post #390

Earlier quoted context omitted.

‘Prelude’ is the set of standard functions and types that you don't have to import to use. Python comes with a rich standard library, but most require imports to use. > How many characters do you have to change if you want it purely in memory? When the question is if ‘K can reduce line count by a factor 1000’, shorter keywords hardly cut it. ‘setdefault’ is wordier than ‘?’, but as something you're only going to use…

> ‘Prelude’ is the set of standard functions and types that you don't have to import to use. Python comes with a rich standard library, but most require imports to use. I might not understand this about python. $ python3 Python 3.7.6 (default, Dec 30 2019, 19:38:26) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> Counter Traceback (most recent c…

Counter is not in Python's prelude. Therefore you have to import it in order to use it.

My comment about prelude was in response to you saying I was using Python's “language+plus-its-entire-ecosystem”. This is not true; Counter is part of the standard library that comes with the language. It is not from a third-party package.

> If it takes that many keystrokes, you're definitely only going to use it once per year! This is the normal way you make enumerations in q/k.

You don't use this frequently in other languages because you almost never care about the index of a value in a hash table (because it's ridiculous), and you almost never want to brute-force unique a list (because it's a footgun).

Re: Stages of denial in encountering K

#403
post #329

Earlier quoted context omitted.

> "harmonises" in the sense that it takes one of the most common programming symbols and changes it? I don't know of anyone that sees "2 & 3 = 2" and thinks "yeah this makes sense". There are a few of us in this thread, trying to explain why. You find outrageous that 2&3=2, almost everyone (all the non-programmers of the world) will find more outrageous that i=i+1. You get used to it quite fast. It's obvious as soon…

> will find more outrageous that i=i+1 Yep, it is hard to understand. That's precisely why I don't like having even more unintuitive things. > It's obvious as soon as you realize that, with booleans, min is and, and max is or. But it's not min and max with the rest of types.

> But it's not min and max with the rest of types.

Yes it is: & is min for all types including boolean, where it is "and" as we can see above. Similarly | is max for all types including boolean, where it is "or". You can convince yourself in binary, or pick up

> it is hard to understand. That's precisely why I don't like having even more unintuitive things.

If I tell you something is "intuitive" I do not mean you should find this approachable knowing what you know. Just as statements on "readability" I find this personalised definition doesn't promote a meaningful discussion, as it depends too heavily on social factors.

Now I don't deny those social factors are important, but if you really mean that, you're basically rejecting learning anything about X because (as at least as a factor) nobody else knows it.

Are you sure you want to be that person? Does anyone?

No of course not. We want to be scientists and evaluate these tools on their own merits. If they are truly new and novel, then we would not expect them to be popular, and so we cannot (if we are to be good scientists) reject them for that reason.

It is for this reason I recommend when someone says "it is readable" we always interpret it to mean if one knows how, and similarly, "it is intuitive", should have an implicit when you are thinking a certain way.

If we do not do this, then we cannot get any value whatsoever from what the other person is saying; if I truly imagine this is what the mean -- that they mean they do not have any interest in being a good scientist and having a discussion about the merits, then they're definitely not worth talking to.

So let me say something about "intuition" under this definition: To me, it is important to understand the relationship between the intuition I can have (or generate) about something, and the memorisation and taxonomy that something requires. "&" is extremely intuitive in this sense because it always has the same definition for every type (It always means the lesser). Most things in k are intuitive like that, and those things that are not, tend to be useful enough that they're worth memorising.

An example of something like the other is "?" which usually means "draw" (As in, that's the most common meaning). You might say 10?100 to draw ten numbers from 0-99. But what would `x?`y? How many is an `x? So k gives another definition to this form (enumerate). This is not intuitive, but if the definition is useful, we will memorise it. This one turns out to be useful.

For the most part, and in the way that I mean, k is very intuitive, and where it is not, it tends to be useful. These are good things!

Re: Stages of denial in encountering K

#404
post #390

Earlier quoted context omitted.

> ‘Prelude’ is the set of standard functions and types that you don't have to import to use. Python comes with a rich standard library, but most require imports to use. I might not understand this about python. $ python3 Python 3.7.6 (default, Dec 30 2019, 19:38:26) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> Counter Traceback (most recent c…

Counter is not in Python's prelude. Therefore you have to import it in order to use it. My comment about prelude was in response to you saying I was using Python's “language+plus-its-entire-ecosystem”. This is not true; Counter is part of the standard library that comes with the language. It is not from a third-party package. > If it takes that many keystrokes, you're definitely only going to use it once per year! Th…

> you saying I was using Python's “language+plus-its-entire-ecosystem”. This is not true; Counter is part of the standard library that comes with the language. It is not from a third-party package.

I'm not sure I agree "third-party package" is a good/useful place to draw the line, but I don't think it's terribly important. Sorry.

> you almost never care about the index of a value in a hash table (because it's ridiculous)

So I want to query all of the referrer urls I've seen recently. I only see a few of them, so I want to have a table of all the URLs, and another table with one row per event (landing on my page). In SQL, you might have a foreign-key operation, but in q, I can also make the enumeration directly. I don't really care about the value of the index, just that I have one.

Re: Stages of denial in encountering K

#405
post #397

Earlier quoted context omitted.

You omitted a key piece of what I said. If you'd like to answer the question I actually asked, feel free. Bonus points if you demonstrate the values you claim to champion here, like open-mindedness and eagerness for sincere discussion.

How did he not answer the question? You asked why you should keep an open mind when encountering and talking about a strange language. He pointed out that it's necessary for a good discussion on it. He's not wrong. You've dismissed every point he made while not knowing a single thing about the topic at hand. That's not grounds for a proper discussion.

That is not what I asked.

What I'm responding to in the thread is a question of pragmatism. In particular, I'm taking issue with the notion that one can only approach this "forgetting what you already know from other languages".

That's very much distinct from the notion of an open mind. And it's especially distinct when we're talking about tools that must fit into a professional context that involves decades of history, millions of people, and a complicated set of economic factors.

For example, Imagine that you were working in a machine shop and I came to you excited about a new screw-head. If you dismissed it out of hand, I might ask you to keep an open mind while I explained why I thought it was better. But if my explanation ignored that the Phillips head was the dominant choice, with billions of drivers and hundreds of billions or perhaps trillions of screws in existence, that would be another thing entirely.

The same logic applies to conlangs like Esperanto and Klingon. Is it possible it would be better if we switched the whole world to Klingon? Sure. Might I learn interesting concepts if I studied Klingon? It's possible. Should Klingon be considered for a moment as an important thing for most people to learn? No, not at all. It's utterly impractical.

So yes, keeping an open mind is valuable. But that's not something I've ever heard seriously disputed, so editing me down to saying that is constructing a straw man. Which also isn't grounds for a proper discussion.

Re: Stages of denial in encountering K

#406

Earlier quoted context omitted.

That's bad in my book. I write a line once for a 100 times I read it.

OTOH, there is something to be said for reading fewer lines in some cases. Conifer forest Vs Pine Pine Cedar Spruce Pine Cedar ...

Isn't Lisp that Conifer forest.

Re: Stages of denial in encountering K

#407
post #316

Earlier quoted context omitted.

There are a lot of books, tutorials, and papers on APL and APL2, which are applicable to GNU APL.

I don't believe so? I started out using APL2; GNU APL seems distinct in ways that are noticeable. Certainly not in a bad way, but I think enough to cause confusion for any newcomer reading said books, tutorials and papers.

The system functions and included workspaces are different, but I haven't had any surprises with the operators so far.

Re: Stages of denial in encountering K

#408
post #397

Earlier quoted context omitted.

You omitted a key piece of what I said. If you'd like to answer the question I actually asked, feel free. Bonus points if you demonstrate the values you claim to champion here, like open-mindedness and eagerness for sincere discussion.

How did he not answer the question? You asked why you should keep an open mind when encountering and talking about a strange language. He pointed out that it's necessary for a good discussion on it. He's not wrong. You've dismissed every point he made while not knowing a single thing about the topic at hand. That's not grounds for a proper discussion.

I read the sum of wpietri's question as saying "so sell K then". As a reader I then looked on to what might be a better selling of K than all the comments I've read so far.

Instead I found silly prose examination.

Re: Stages of denial in encountering K

#409
post #347

This article should end with something like, "...and then you find out about arcfide's Co-dfns compiler..." https://github.com/Co-dfns/Co-dfns You don't have to like it, but the existence of K, et. al. shows that most of us are wasting a huge amount of time and energy using bad tools. These things are so powerful and not that hard to learn.

It shows no such thing. It shows that you have found something you think you can be productive in and that you like, not that the rest of us are on the wrong track.

I can't agree. (BTW, I don't like K, and I don't use it, but if I did I'd like to think I'd be productive in it.)

This little system runs circles around entire sub-industries of other software. The fact that it exists and uses one or two orders of magnitude less time and code than other systems is significant.

It's like axes vs. chainsaws. If the job is to log a forest the latter will be better than the former.

Re: Stages of denial in encountering K

#410
post #398

Earlier quoted context omitted.

> APL/J/K can be very fast for an interpreted language, but they won't beat C, C++, Fortran, and Java in most cases. Do APL/j/k/q work well for some performance-sensitive situations but not others? Some of the comments here by people who appear to be very familiar with the language make it seem like it performs quite well compared to the traditional high-performance languages. Distribution is definitely something I h…

Worth noting that most APL interpreters and the J interpreter are significantly slower than (most) k/q interpreters. I'm not sure if the performance argument is relevant for all of them. Arthur Whitney's a biased source, of course, but the kparc site has a bunch of little programs in which he beats the equivalents from rather influential people (like the UNIX/Plan 9/Inferno authors http://www.kparc.com/z/bell.k ) for…

Is there publicly available information on what makes k/q interpreters so much faster? Or is that part of the secret sauce that the companies maintaining those interpreters sell? I assume it's the latter, but hope for the former, since good descriptions of the technical work that goes into high-performance systems usually makes for fascinating reading.
Post reply on HN