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.

The Notation: Ken Iverson Centenary

84 pointsby 5jtover 4 years ago

7 comments

sxpover 4 years ago
&gt; ”K programs routinely outperform hand-coded C. This is theoretically impossible. K compiles into C. Every k program has a C equivalent that runs exactly as fast. Yet it is true in practice. Why? Because it is easier to see your error in four lines of code than in four hundred lines of C.”<p>How true is this? I hear this claim a lot but haven&#x27;t seen any real benchmarks. E.g, <a href="https:&#x2F;&#x2F;benchmarksgame-team.pages.debian.net&#x2F;benchmarksgame&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;benchmarksgame-team.pages.debian.net&#x2F;benchmarksgame&#x2F;...</a> doesn&#x27;t have K or any related languages.<p>I&#x27;m guessing K is fast due to autovectorization for certain cases, but are there benchmarks that provide hard numbers? The existence of a benchmark prohibition clause in the kdb license makes me skeptical of its performance claims.<p><a href="https:&#x2F;&#x2F;tech.marksblogg.com&#x2F;benchmarks.html" rel="nofollow">https:&#x2F;&#x2F;tech.marksblogg.com&#x2F;benchmarks.html</a> has a kdb benchmark, but due to the use of Xeon Phis, it can&#x27;t be compared with other benchmarks there.
评论 #25474455 未加载
评论 #25475851 未加载
评论 #25474924 未加载
评论 #25474165 未加载
评论 #25474501 未加载
评论 #25474192 未加载
评论 #25474161 未加载
jodrellblankover 4 years ago
&gt; &quot;<i>Iverson was more interested in how quickly a person could understand an algorithm</i>&quot;<p>Has there been any study of whether J is quicker or slower than APL for this? Subjectively, APL is pretty and enticing in a way that J isn&#x27;t.<p>It&#x27;s very strange to me that someone who promoted Iverson Notation as a better math notation, and wrote Notation as a Tool of Thought, could apparently completely switch notation from 30 years of established APL symbols to pairs of ASCII symbols, effectively overnight, and carry on as if nothing was any different.<p>How much of J&#x27;s success is because J was free and the big APLs were a lot of money, so J has been &quot;the free way to get an array language experience&quot; for years?
评论 #25476395 未加载
评论 #25474589 未加载
ogogmadover 4 years ago
Iverson bracket notation is named after him: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Iverson_bracket" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Iverson_bracket</a>
tlover 4 years ago
&gt; Glory days. Long before spreadsheets, IBM managers wrote their budgets in APL, and lucrative timesharing services supported users around the world.<p>Imagine a world where spreadsheets grew from being a living, easily accessible version of everything APL offered (which has been true for about two decades) into everything Q (and kdb+) supports including serving web content and cross-platform database queries.
ogogmadover 4 years ago
How does using APL&#x2F;J&#x2F;K compare to using Julia, Numpy or Matlab? The fact that in the latter you still have the safety blanket of procedural programming makes it seem easier to learn and more productive.
评论 #25476325 未加载
评论 #25478823 未加载
7thaccountover 4 years ago
Very interesting article.
eggyover 4 years ago
I found J in 2011 or early 2012. I fell in love with it due to the terse, expressive notation set against pages of typical programming code from other languages. I have since moved to Dyalog APL. Roger Hui of APL&#x2F;J fame, now contributes to Dyalog APL, so a lot of the novel ideas in J have made their way back into APL (Dyalog and NARS).<p>I read my first book on neural networks in 1988, and I got the matrix math and the implementation of them, but this year I was able to really grasp them in a more basic way with an implementation of Convolutional Neural Network in APL in only 10 functions&#x2F;lines of code [1]. Amazing! What&#x27;s even more surprising is that they manually translated it to SAC (Single Assignment C), and it is faster than TensorFlow. The interpreter is not bad either - 20x less time to init than TF, but 20x and 5x slower to train and test respectively. Compilers for APL are being worked on to make it work without the manual translation. To me the similarity to the math formulas, being able to view and work through the code in front of me in one view, is priceless. I also enjoy it, and I believe (no evidence here) that it is exercising my mind on the problem more directly than winding my mind around pages of Python&#x2F;C or other PLs. Certainly a lot of the original ideas of APL and current successes of things like Pandas and NumPy owe a lot to the array languages in the APL family.<p>There&#x27;s an example of an Extreme Learning Machine in J, but I don&#x27;t have the link at the moment. I go back and forth with J and APL, and I am currently learning Rust. Somebody coded APL in Rust, but it has not been fleshed out. I find myself attacking problems in J&#x2F;APL on my desktop, and sometimes that&#x27;s it, I don&#x27;t require another solution, or if I do I recreate it in C&#x2F;Python or now Rust.<p>Aaron Hsu does amazing work in APL. He is&#x2F;was a former Schemer [2].<p>A taste of J or APL with an average function implementation:<p>J: avg=: +&#x2F;%#<p>APL: avg←+&#x2F;÷≢<p>They both map&#x2F;apply the &#x27;+&#x27; operator over a vector&#x2F;array, then divide the sum by the tally or count of terms given.<p>Great tribute to Ken Iverson!<p>10 line CNN implemented in APL (the stencil operator ⌺is great! It allows you to move a window over your array):<p>blog←{⍺×⍵×1-⍵}<p>backbias←{+&#x2F;,⍵}<p>logistic←{÷1+<i>-⍵}<p>maxpos←{(,⍵)⍳⌈&#x2F;,⍵}<p>backavgpool←{2⌿2&#x2F;⍵÷4}⍤2<p>meansqerr←{÷∘2+&#x2F;,(⍺-⍵)</i>2}<p>avgpool←{÷∘4{+&#x2F;,⍵}⌺(22⍴2)⍤2⊢⍵}<p>conv←{s←1+(⍴⍵)-⍴⍺⋄⊃+&#x2F;,⍺×(⍳⍴⍺){s↑⍺↓⍵} ̈⊂⍵}<p>backin←{(dwin)←⍵⋄⊃+&#x2F;,w{(⍴in)↑(-⍵+⍴d)↑⍺×d} ̈⍳⍴w}<p>multiconv←{(awsbs)←⍵⋄bs{⍺+⍵conva}⍤(0,(⍴⍴a))⊢ws}<p>[1] <a href="https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;10.1145&#x2F;3315454.3329960" rel="nofollow">https:&#x2F;&#x2F;dl.acm.org&#x2F;doi&#x2F;10.1145&#x2F;3315454.3329960</a> (PDF link is on page)<p>[2] <a href="https:&#x2F;&#x2F;aplwiki.com&#x2F;wiki&#x2F;Aaron_Hsu" rel="nofollow">https:&#x2F;&#x2F;aplwiki.com&#x2F;wiki&#x2F;Aaron_Hsu</a>