TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Stages of Denial

225 pointsby clashmeifyoucanalmost 4 years ago

25 comments

TheAceOfHeartsalmost 4 years ago
This is a category of cursed knowledge which causes psychic damage to the reader.<p>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&#x27;t widely adopted.<p>To free yourself from this curse write ten regular for-loops in C and say a prayer to K&amp;R while tighly holding your copy of The C Programming Language.
评论 #28130128 未加载
评论 #28126788 未加载
评论 #28127207 未加载
评论 #28127326 未加载
评论 #28126978 未加载
评论 #28126136 未加载
anyfooalmost 4 years ago
I&#x27;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].<p>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 read out loud as &quot;percent-percent-at-squiggly&quot; and &quot;hat-dot-dot&quot; stand for (withIndex and toListOf respectively).<p>But arguably, the ones that are long and seldom used need looking up anyway, and their name is not that much more useful maybe?<p>[1] Also compare &quot;2+2*8&quot; with &quot;sum 2 to the product of 2 and 8&quot;, or even just &quot;sum(2,prod(2,8))&quot;.
评论 #28124226 未加载
评论 #28124483 未加载
评论 #28125052 未加载
评论 #28123939 未加载
chiphalmost 4 years ago
<p><pre><code> {x#x{x,+&#x2F;-2#x}&#x2F;0 1} </code></pre> I&#x27;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.
评论 #28124361 未加载
评论 #28124067 未加载
评论 #28126250 未加载
评论 #28127114 未加载
评论 #28128116 未加载
评论 #28124390 未加载
tarxzvfalmost 4 years ago
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 between ideas.
评论 #28125595 未加载
评论 #28126811 未加载
nine_kalmost 4 years ago
&gt; <i>Does giving a K idiom a name make it clearer, or does it obscure what is actually happening?</i><p>There&#x27;s a balancing act around that. It&#x27;s called &quot;abstraction&quot;.<p>At some point, you <i>cannot afford to know</i> what&#x27;s actually happening. If you try, the entire problem won&#x27;t fit in your head. So you cut the thing you&#x27;re working with to a name and an interface, and forget what&#x27;s &quot;actually happening&quot;. You do that right in the K code, because you e.g. cut your understanding of `&#x2F;` to &quot;fold the array with the preceding operation&quot;, and totally don&#x27;t think about the way it&#x27;s implemented in the machine code.<p>This, of course, does have a cost; the simplest case is inefficiency, worse are circuitous ways to arrive to logically the same result, when a much simpler way exists.<p>I&#x27;d argue that `&#x2F;` or `+` are very much names, of the same nature as `fold` or `add`, just expressed shorter. So if you prefer point-free style, you can likely do a very similar thing in, say, Haskell (and some people do).<p>I&#x27;d hazard to say that APL and J are DSLs for array &#x2F; matrix numeric code. They allow to express certain things in a very succinct way. What APL traditionally had, mmm, less than ideal experience was I&#x2F;O, because the language is not optimized for the branchy logic required to handle it robustly. K is a next step that allows to escape into &quot;normal-looking&quot; language with long names, explicit argument passing, etc when you feel like it.<p>Also, I love this idea: «APL <i>has</i> flourished, as a DSL embedded in a language with excellent I&#x2F;O. It&#x27;s just got weird syntax and is called Numpy.» (<a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17176147" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=17176147</a>) The ideas behind APL &#x2F; J &#x2F; K are more interesting than the syntax, and haven&#x27;t been lost.
评论 #28127467 未加载
评论 #28129143 未加载
turbinerneiteralmost 4 years ago
I recently started using rust-analyzer with vscode.<p>One common sight is this:<p>thing<p><pre><code> .stuff() .other() .whatevs() </code></pre> Each of the calls returns a different type. Rust-analyzer displays the return type of each call to the right of it.<p>I imagine something similar could reconcile the benefits of terseness with readability and discoverabilty.<p>The blog post already has the prototype:<p>+ &#x2F; ! 100<p>plus reduce range 100<p>Imagine the second line being added in by your ide in a light gray.
评论 #28126720 未加载
评论 #28126020 未加载
peterburkimsheralmost 4 years ago
The uncanny rapport I feel by reading &quot;lazy Tuesday afternoon, visiting The Orange Website, self-consciously averting your eyes from the C compiler output in a nearby terminal&quot; builds enough trust that I&#x27;m willing to pay attention to what John Earnest (IJ or RtG) has to say about this. He&#x27;s a great writer.<p>Naming things is hard. It&#x27;s one of the 2 most difficult problems in CS, along with cache invalidation and off-by-one errors. Of course, in this context I mean &quot;CS&quot; as &quot;Computer Science&quot;, not &quot;CouchSurfing&quot;.<p>For the K programming language, meanings are specifically defined. In the article:<p>&quot;The word “ordinal” can mean anything, but the composition &lt;&lt; has exactly one meaning.&quot;<p>That&#x27;s fine for the K compiler, but not for Google Search, or grep. I use &quot;&lt;&lt;&quot; to mean a bit shift to the left, presumably because I was taught C in university.<p>Unique names are more useful for addressing (e.g. IPV6) but common names are more memorable (e.g. a URL. Translators (e.g. DNS) can&#x27;t be perfect when there&#x27;s a one-to-many or many-to-one correlation, but they try their best.<p>K does well to enforce structure, but in the process, makes it very hard for the programmer to find examples and other documentation. I guess that&#x27;s why the language hasn&#x27;t become as popular as other languages, whose syntax is sufficiently familiar to be legible and memorable but unique enough to be searchable.
raldialmost 4 years ago
I guess the ending is supposed to be a joke, but because the piece never explains what | means, I couldn’t figure it out.
评论 #28123465 未加载
jitlalmost 4 years ago
<p><pre><code> Math.max(...list)</code></pre>
评论 #28124679 未加载
评论 #28124142 未加载
评论 #28124057 未加载
LAC-Techalmost 4 years ago
So are array languages polish notation?<p><pre><code> +&#x2F;!100 </code></pre> feels like the opposite way you&#x27;d write it in some kind of RPN concatenative language<p><pre><code> 100 ! [ + ] &#x2F;</code></pre>
评论 #28123900 未加载
评论 #28128226 未加载
评论 #28123774 未加载
pdimitaralmost 4 years ago
Programming language syntax is very much like the human languages themselves: it (re-)shapes your thinking.<p>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.<p>If your language isn&#x27;t giving me that then it&#x27;s bye bye.<p>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.
kubbalmost 4 years ago
I love the bit about junior stanford educated Google employees :)
kleene_opalmost 4 years ago
In my opinion, the conceal feature in Vim provides the best of both world to the name vs symbol problem.<p>When you want to review your code, you just go into normal mode, concealing all lengthy but frequent names into appealing symbols. When you want to write code, you switch to editing mode and all symbols on the editing line turn back into names<p>I use this feature mostly with python code. One liners making proficient use of lambdas, maps, reduces, and other functional treats are satisfyingly condensed, reducing the amount of attention required to parse each line.<p>No need for custom keyboards. People don&#x27;t have to parse arbitrary symbols to understand what I wrote because the underlying code remains vanilla.<p>A drawback is that the apparent conciseness tricks me into writing very big one-liners difficult to parse when all terms are expanded.
gHostsalmost 4 years ago
This is either the most important paper in Computer Science.... or a trivial side effect of representing function composition by string concatenation...<p><a href="http:&#x2F;&#x2F;nsl.com&#x2F;papers&#x2F;rewritejoy.html" rel="nofollow">http:&#x2F;&#x2F;nsl.com&#x2F;papers&#x2F;rewritejoy.html</a>
评论 #28128743 未加载
nope96almost 4 years ago
also posted previously as<p>Stages of denial in encountering K, March 9, 2020, 422 comments <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22504106" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22504106</a>
dmoralmost 4 years ago
Wow, this is art<p>Wonder how many people did not skip to the end and then skim back
评论 #28124655 未加载
vanderZwanalmost 4 years ago
&gt; list.reduce((x,y)=&gt;Math.max(x,y))<p>Honestly, while I like the clarity, I would still dislike it <i>in JavaScript</i> for performance reasons, because <i>in JavaScript</i> reduce is not optimized at all. And yes, I do work on a code-base where that difference is significant.<p>Also, that loop can still be cleaned up a bit in modern JS:<p><pre><code> let max = list[0]; for (const v of list) { if (v &gt; max) max = v; }</code></pre>
marrowgarialmost 4 years ago
A slightly more verbose (less abstract) version of k would be q. Kx (proprietary owners of k&#x2F;q) have a nice reference page if you&#x27;re interested in learning more about the language, e.g., where it&#x27;s used and how it&#x27;s used... <a href="https:&#x2F;&#x2F;code.kx.com&#x2F;q&#x2F;ref&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.kx.com&#x2F;q&#x2F;ref&#x2F;</a>
chronolitusalmost 4 years ago
Maybe the issue is that the symbols we readily accept are the ones we grew up with when learning Mathematics, + - * &#x2F; ^ % = ..<p>If &#x27;reduce&#x27; and &#x27;map&#x27; had widely used symbols, which were taught in school &#x2F; university as part of the standard curriculum, how different would coding look today?
eevilspockalmost 4 years ago
Hint: K is the name of the central character in Franz Kafka&#x27;s <i>The Castle</i>, as well as that of <i>The Trial</i>.<p><i>&gt; &quot;The term &quot;Kafkaesque&quot; is used to describe concepts and situations reminiscent of Kafka&#x27;s work, particularly Der Process (The Trial) and Die Verwandlung (The Metamorphosis). Examples include instances in which bureaucracies overpower people, often in a surreal, nightmarish milieu that evokes feelings of senselessness, disorientation, and helplessness. Characters in a Kafkaesque setting often lack a clear course of action to escape a labyrinthine situation. Kafkaesque elements often appear in existential works, but the term has transcended the literary realm to apply to real-life occurrences and situations that are incomprehensibly complex, bizarre, or illogical.&quot;</i><p>~ <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Franz_Kafka#%22Kafkaesque%22" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Franz_Kafka#%22Kafkaesque%22</a>
gjulianmalmost 4 years ago
I remember a discussion on HN on this language like a year ago or so. In the end what I got was some extremely weird snippets for very specific little quizzes that someone claimed were faster than with other languages, the argument that &quot;it&#x27;s shorter&quot; and &quot;but I can work with it&quot;.<p>So yeah, if you like it, I get it, go enjoy it. But this smugness of &quot;it&#x27;s actually better and I&#x27;m better for knowing it&quot;, it irks me. One of the most important aspects of programming languages is that they need to be used, and K is the single hardest language that I&#x27;ve tried to understand, even with documentation on the other screen and reading just short snippets. A language that people will ignore because they don&#x27;t even know where to start reading is not that good of a language.
评论 #28130330 未加载
z3t4almost 4 years ago
I already have problems reading arrow&#x2F;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.
评论 #28128598 未加载
评论 #28125727 未加载
goto11almost 4 years ago
So it is a language with single-character symbols for the most common array operations like map, filter etc.<p>I think the article tries to make it sound more mysterious and groundbreaking than it really is.
评论 #28126847 未加载
BugsJustFindMealmost 4 years ago
&gt; <i>a more direct translation into another language might look like: range(100).reduce(plus, 0)</i><p>That&#x27;s...uhh...one way to do it. But it&#x27;s a lot shittier to read than sum(range(100)).
评论 #28126413 未加载
评论 #28124669 未加载
smoldesualmost 4 years ago
One important thing to remember about esolangs like this is that theory != implementation. Just because Brainfuck &quot;theoretically&quot; exists as a language doesn&#x27;t automatically solve issues like memory management or extensibility. Sure, <i>maybe it is</i> more ergonomic to write some functions in K. But, as with most code-golfing languages, the goal isn&#x27;t to build a better language, it&#x27;s to build a faster one.<p>Maybe K <i>can</i> run those programs faster than Lisp&#x2F;C&#x2F;$FAV_LANG, but it&#x27;s ultimately up to a much smarter programmer to implement that bit.
评论 #28123976 未加载
评论 #28124160 未加载
评论 #28126556 未加载