This is a category of cursed knowledge which causes psychic damage to the reader. When you go down certain rabbit holes you develop a fascination with obscure forms of programming and start to realize it has some powerful benefits of which you can never take advantage because it isn't widely adopted. To free yourself from this curse write ten regular for-loops in C and say a prayer to K&R while tighly holding your co…
Stages of Denial
71–80 of 119 posts
Re: Stages of Denial
#72Just replace K and JavaScript with German and English to see the vacuity of this argument. Either of several possible representations can become native to one’s thinking. The question is which is a better aid in reaching some non-arbitrary goal. The only merit of K presented and emphasized here was the supposed brevity of its programs. Personally I’ve found the habitable zone somewhere that allows for more air betwee…
Re: Stages of Denial
#73So it is a language with single-character symbols for the most common array operations like map, filter etc. I think the article tries to make it sound more mysterious and groundbreaking than it really is.
Re: Stages of Denial
#74I want to learn things that shape my thinking in a way that makes me more efficient, and in a way that makes it easier to express ideas.
If your language isn't giving me that then it's bye bye.
I get the appeal but squinting your eyes at a string of single-character symbols is taking it too far. The whole thing has to be somewhat ergonomic as well.
Re: Stages of Denial
#75This is a category of cursed knowledge which causes psychic damage to the reader. When you go down certain rabbit holes you develop a fascination with obscure forms of programming and start to realize it has some powerful benefits of which you can never take advantage because it isn't widely adopted. To free yourself from this curse write ten regular for-loops in C and say a prayer to K&R while tighly holding your co…
Re: Stages of Denial
#76Earlier quoted context omitted.
IIRC the spread syntax only works with relatively small arrays, because it's function application at the end of the day. So worthwhile keeping in mind that the nice JS code falls apart.
Fair point. In any case, if you wanted to do more than trivial array processing in JS, you would use a library like lodash which have an array max function. And if you think lodash is still to verbose, you can define your own: const å = list => list.reduce((x,y) => Math.max(x, y)); Now you can write å(list) to get the max value of an array!
Re: Stages of Denial
#77This is a category of cursed knowledge which causes psychic damage to the reader. When you go down certain rabbit holes you develop a fascination with obscure forms of programming and start to realize it has some powerful benefits of which you can never take advantage because it isn't widely adopted. To free yourself from this curse write ten regular for-loops in C and say a prayer to K&R while tighly holding your co…
I find it rather weird to compare K to C. In what circumstances would the choice be between K and C? A more reasonable comparison would be between say Python with numerical libraries and K.
Re: Stages of Denial
#78I'm torn. Not about the conciseness of the language overall, but about using symbols vs. names. I do see how the symbols make things more concise, less clutter, and can even make it easier to grasp a piece of code if you are deeply familiar with them[1]. On the other hand, there might be a limit. I do know how it is to use the Haskell lens package only occasionally, and then having to lookup again what the operators…
The trouble in Haskell is that an operator like %%@~ is just an arbitrary name. In languages like K or APL, the combination of symbols is the actual definition.
Re: Stages of Denial
#79I recently started using rust-analyzer with vscode. One common sight is this: thing .stuff() .other() .whatevs() Each of the calls returns a different type. Rust-analyzer displays the return type of each call to the right of it. I imagine something similar could reconcile the benefits of terseness with readability and discoverabilty. The blog post already has the prototype: + / ! 100 plus reduce range 100 Imagine the…
But why not just write (0 to 99).sum That's not much longer, and quite readable even for the uninitiated. (It's a Scala expression, so not made up).
or (0 ..= 99).sum() for range including the 99
which makes me think that i don't know how to read (0 to 99) unless i learn whether it's exclusive or inclusive (but at least it's googlable, unlike a random looking operator)
Re: Stages of Denial
#80{x#x{x,+/-2#x}/0 1} I'm sure if you used K for a year or so, that would be obvious and understandable at a single glance. But all I can think of is that I used to see that in my terminal session right after my modem got disconnected.
kvPairs.reduce((acc, [k,v]) => ({...acc, [k]: v}), {})
(Which obviously has nothing to do with the K-Snippet but is the first thing that came to my mind that's equally as symbol-heavy)