Live data from Hacker News

Stages of Denial

beyondloom.com

51–60 of 119 posts

Re: Stages of Denial

#51
post #43

I already have problems reading arrow/inline functions... for example where a method is called with a function that returns a function... if there is one more (async) call in there my brain starts smoking.

It's all up to preference, really. It took me a while to get around my muscle memory from general imperative programming by the time I started using languages like K competently. Getting that motivation is definitely hard.

Re: Stages of Denial

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

Re: Stages of Denial

#53

Earlier quoted context omitted.

Not quite. + isn’t the last thing done (which it would be in Polish notation). Instead it’s done during the / operation. Polish notation would be lisp (or the notion most people have for lisp, special forms and macros break it up a bit).

Lisp is polish notation for trees of variable arity. hence all the parens - you need some way to group them. So in some K flavoured LISP I think it would be ((/ +) (! 100))

Or in clojure with the threading macro

    (->> 100 range (reduce +))
which is equivalent to this, without the macro

    (reduce + (range 100))

Re: Stages of Denial

#54

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…

> Imagine the second line being added in by your ide in a light gray.

So what would be the benefit compared to just writing `plus reduce range 100`?

Re: Stages of Denial

#56

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…

Ah, true!

Re: Stages of Denial

#57
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.

How many years did you spend on mathematics? How comfortable are you with reading math notation?

I think the same problem applies. If you don't remember the specific of a symbol it becomes difficult to understand what the symbol might be without context.

Re: Stages of Denial

#58
post #26

Earlier quoted context omitted.

Huh, I had no idea that function had variable arity. Thanks.

Funnily enough, that variable arity is mentioned in the article as a nuisance: > ... wincing slightly at the lambda notation you need to avoid running afoul of JavaScript’s variadic Math.max()...

It is a typical language-comparison strawman. He is writing

   list.reduce((x,y)=>Math.max(x,y)) 
To get the max number in a list. And he is "winching" because he can't write:

    list.reduce(Math.max)
Because the variable arity of max does not play well with reduce. But because of the variable arity he can write:

    Math.max(...list)
Which is even simpler.

So he deliberately writes overly complex JavaScript code to show how the other language is more concise.

Re: Stages of Denial

#59
post #58
post #26

Earlier quoted context omitted.

Funnily enough, that variable arity is mentioned in the article as a nuisance: > ... wincing slightly at the lambda notation you need to avoid running afoul of JavaScript’s variadic Math.max()...

It is a typical language-comparison strawman. He is writing list.reduce((x,y)=>Math.max(x,y)) To get the max number in a list. And he is "winching" because he can't write: list.reduce(Math.max) Because the variable arity of max does not play well with reduce. But because of the variable arity he can write: Math.max(...list) Which is even simpler. So he deliberately writes overly complex JavaScript code to show how th…

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.

Re: Stages of Denial

#60
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…

> 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]. I think the "if you are deeply familiar with them" is important. Using non-standard symbols makes comprehension more binary: either you've memorized them and under…

Are you talking about vim? I thought this article was about programming languages.
Post reply on HN