Live data from Hacker News

Stages of Denial

beyondloom.com

71–80 of 119 posts

Re: Stages of Denial

#71

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…

Can I write one regular for loop to ten around one regular for loop, instead of ten regular for loops?

Re: Stages of Denial

#72
post #23

Just 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…

Sorry to be pedantic, but even if you said english and chinese, the analogy would still be off IMHO.

Re: Stages of Denial

#73
post #52

So 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.

the symbols compose in both directions and are aware of tacit parameters, so I don't really think your summary is even remotely correct

Re: Stages of Denial

#74
Programming language syntax is very much like the human languages themselves: it (re-)shapes your thinking.

I 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

#75

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…

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

#76
post #66

Earlier 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!

well yeah I could also write a function in C that does that. I don't think that's the point.

Re: Stages of Denial

#77
post #75

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…

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.

K&R is a common nickname for the book "The C programming language" by Kernighan and Ritchie, and a reference to the authors:

https://en.m.wikipedia.org/wiki/The_C_Programming_Language

Re: Stages of Denial

#78
post #9

I'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.

lens operators in haskell at least have some structure https://news.ycombinator.com/item?id=28124226

Re: Stages of Denial

#79

I 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).

in rust you would write (0 .. 99).sum() for range not including 99

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
post #14

{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.

Is it that much worse than, for instance:

  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)
Post reply on HN