HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Dyalog '18: High-performance Tree Wrangling, the APL Way

Dyalog Usermeeting · Youtube · 2 HN points · 3 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Dyalog Usermeeting's video "Dyalog '18: High-performance Tree Wrangling, the APL Way".
Youtube Summary
Aaron Hsu, Indiana University (U.S.A.)

Don't let hierarchical tree like structures get you down in APL-land. Despite what modern C.S. theorists would have you believe, there's more than one way to prune, chop, graft and otherwise mangle and wrestle with tree data.

Aaron discusses a novel approach to interacting with Trees, particularly in the manipulation and transformation of trees, that leverages the unique and special qualities of APL to achieve not only greatly reduced code size, but also improved performance, amenability to parallelisation and ease of maintenance/productivity improvements. These techniques are easy to pick up, general and practical.

TL;DR – Why everything you learned about working with trees in University is wrong.
HN Theater Rankings

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this video.
> "his saves on allocations, saves on total memory usage"

Co-Dfns is Aaron Hsu's project, and he has a talk[1] on a compiler implemented in a nano-pass style, once in Racket, once in Chez Scheme[2] and once in Dyalog APL, each using CPU and GPU.

For compiling an AST with ~16 million nodes, he gives benchmark figures that Dyalog APL takes 64MB RAM to hold it, Racket takes 1051MB and Chez Scheme takes 1485MB. His provocative statement for the talk is "pointers are the refined sugar of programming". The APL version is 1/50th of the lines of code[4], runs typically 9x faster on the CPU, 50x-200x faster on the GPU, despite being interpreted by Dyalog vs compiled Scheme. There are benchmarks where the APL version loses in runtime, under 1k lines of code (which he calls "tiny tiny") so lots of startup overhead and not enough big arrays to gain ground on.

He has one talk (available on YouTube) about his approach to using arrays to working with tree structures in a high-performance way in APL[3].

[1] https://www.youtube.com/watch?v=UDqx1afGtQc

[2] he used to be on the Scheme R6RS steering committee, so he's not new/inexperienced with it http://www.r6rs.org/steering-committee/election/electorate.h...

[3] https://www.youtube.com/watch?v=hzPd3umu78g

[4] 17 lines of code which took a PhD researcher (him) 5-10 years to write, mind you.

sitkack
Two issues here, we are at a memory wall, and if system X takes 64MB and system Y takes 1024MB, that is 4 doublings. So the 9x faster number holds. APL in this case is like being 4 Moore Units ahead of everyone else.

The other one is that, separating the thing from the representation of the links between things is not unlike a set of basis functions forming a high dimensional space. The indices into the store forming a point in that space.

Some say Petgraph is a hack, I think Petgraph is a mathematical sculpture.

I had this feeling exactly listening (great, as everything Aaron does) presentation about manipulation and transformation of trees in APL, https://www.youtube.com/watch?v=hzPd3umu78g
Qualification: I was introduced to FP a number of years ago and have finally reached a point where I feel that I have a deep understanding of FP in general. In my mind, Haskell is the "best" language out there ("best" in that it provides the best overall gain when all tradeoffs are considered).

I'm no longer confident that Haskell is the "best" language anymore. I was recently introduced to a language that might be even better than Haskell: Dyalog APL. (https://www.dyalog.com/). Try it out yourself (https://tryapl.org/)

To explain why, I recommend watching Aaron Hsu's videos on Dyalog APL:

- Does APL need a Type System? (https://www.youtube.com/watch?v=z8MVKianh54) - This is actually a very interesting question that is more nuanced than upon first glance.

- Design Patterns and Anti-Patterns in APL (https://www.youtube.com/watch?v=v7Mt0GYHU9A) - The main takeaway from this video for me was the principle of "Idioms over libraries."

- Higher Performance Tree-Wrangling, the APL way (https://www.youtube.com/watch?v=hzPd3umu78g) - Or how to model Trees without using pointers by using "Inverted Tables." (An inverted table is a table where the columns are the rows and the rows are the columns)

Dec 14, 2018 · 2 points, 0 comments · submitted by somezero
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.