HNHacker News
TopNewBestAskShowJobs

skruger

511 karma · joined December 6, 2016

I dabble in array languages

<https://xpqz.github.io/learnapl>

<https://xpqz.github.io/cultivations>

<https://xpqz.github.io/kbook>

submissionscomments
skruger··on APLcart – Find your way in APL
APLcart is a searchable idiom collection database — snippets of code that you can search for with a “how do I achieve X” type question. I’ve not seen this for languages outside the Iverson family, but it could be equally useful for other languages, too. Note that it’s accessible from within Dyalog apl as a user command: ]aplcart
skruger··on APL: An Array Oriented Programming Language (2018)
Start here (disclaimer: author) https://xpqz.github.io/learnapl/intro.html
skruger··on APL: An Array Oriented Programming Language (2018)
If that’s what you really want, you end up with numpy, which — whilst efficient in its niche — ends up as a pale imitation of the real thing. I’d urge you to try a modern APL to really experience the power of the Iverson vision.
skruger··on PyPattyrn: A simple library for implementing common design patterns
The “Gang of Four” book is the classic reference https://en.m.wikipedia.org/wiki/Design_Patterns
skruger··on Ask HN: What was the best software that you used during 2022?
Dyalog APL.
skruger··on The APL Source Code (2012)
If you’re interested in learning modern APL, check out https://xpqz.github.io/learnapl

Disclaimer: author

skruger··on APL deserves its renaissance too (2018)
And, of course, for Perl-fans, Dyalog APL supports the full-fat PCRE, too :)
skruger··on APL deserves its renaissance too (2018)
Yet millions of Japanese people are fairly adept at reading it. To be clear, APL actually has a tiny set of symbols. In day to day use, perhaps two dozen. Remember that these aren't "keywords" in the traditional sense, but more like the standard library. Contrary to popular belief, it's actually pretty easy to learn to read, as usually the symbols are mnemonic, or referencing well-known mathematical counterparts. Flipping a matrix in various ways is a circle and a line. For example, ⍉ means "flip diagonally" -- in other words, a transpose. To flip around the horizontal axis, guess the symbol: ⊖. Around the vertical? ⌽. The ceiling of a number is borrowed from maths: ⌈ etc. Counting the elements in an array is ≢ -- evoking the symbols you scratch on a piece of paper when tallying something up.
skruger··on APL deserves its renaissance too (2018)
Speaking for myself, I find that whenever I think "I just can't see how..." it makes me want to figure out what it is that others can see that I can't. This is the reason I learnt APL, actually, after seeing half a page of k code and feeling annoyed that I couldn't read it. k subsequently led me to APL.

You can try it for yourself -- NumPy is a fair "Iverson ghost" -- APL without the symbols: it has a similar enough array model, and most of the APL primitives as functions or methods. APL lets you express linear algebra in a very natural way. Doing it in NumPy is much more convoluted.

Or try Rob Pike's (of Go fame) "ivy" -- his attempt at an APL-with-words (https://github.com/robpike/ivy).

skruger··on APL deserves its renaissance too (2018)
There are a lot of comments of the type "it's unreadable/write-only/unmaintainable" here. It's a natural reaction; I know, I was there. It looks different. But readability is in the eyes of the beholder, not the language. I made this point in my APL book (https://xpqz.github.io/learnapl) -- just because I can't read Japanese does not make Japanese unreadable. Since I wrote that book, I've spent a few years immersing myself in APL, gradually rewriting thousands of lines of Python into APL, and it's such a productivity boost. My code is an order of magnitude smaller. More, sometimes. Fast, too.

For the right use cases, it's unbeatable. Sure, you probably wouldn't want to write an OS kernel in it, but anything that reads a bunch of data, mashes it up, and spits out some result, APL is a hand-in-glove fit. And with modern SIMD processors, APL really screams.

https://xpqz.github.io/learnapl

https://xpqz.github.io/cultivations

Drop in on https://apl.chat if you're interested.

skruger··on Why Lisp?
Clojure is pretty sprightly, perhaps even prolific, surely. For example, if you're in any way interested in databases, you will have come across https://jepsen.io/ who do all their testing using Clojure.
skruger··on Ask HN: What piece of code/codebase blew your mind when you saw it?
Arthur Whitney’s J Incunabulum: https://code.jsoftware.com/wiki/Essays/Incunabulum
skruger··on Why Racket? Why Lisp? (2014)
https://phoenixframework.org/
skruger··on Why Racket? Why Lisp? (2014)
https://elm-lang.org/
skruger··on Top Programming Languages 2022
Wait, no APL?
skruger··on Ambient Scotrail Beats – Relax to Scottish train announcements over low-fi beats
This will be the new soundtrack to my life. Many thanks, Matt
skruger··on Notation as a Tool of Thought (1979)
I use APL for any task I previously used Python for, involving grabbing some data typically via a json-over-http API, massaging, aggregating and otherwise combining it to produce summaries or reports. I've gradually rewritten my bunch of scripts and code I use daily from python to APL, and seen a 10-100x reduction in code size, and usually a significant speed-up (admittedly, Python is a low bar here).
skruger··on Notation as a Tool of Thought (1979)
If you haven't seen it, I wrote an intro to modern APL you might enjoy if you're starting out: https://xpqz.github.io/learnapl
skruger··on Notation as a Tool of Thought (1979)
I am an APL-fan specifically because it's like a parallel universe where evolution took a different path: what are often considered anti-patterns in main stream languages is best practice in APL. It's a welcome relief from the strait-jacket of "the Zen of Python". No libraries? It's a feature. Single-letter variable names? Of course. Terseness as a virtue? Oh yes. Right-to-left flow? Why not? Precedence levels? Who needs them? Tacit? Bring it on. APL is easily the most productive tool in my chest.
skruger··on Notation as a Tool of Thought (1979)
If you're familiar with both modern APL and the "Iverson ghost" NumPy, you'll likely find the latter a frustratingly crippled experience.
skruger··on Concatenation is composition
I’ve written a gentle intro to APL for experienced programmers if you’re interested in making it a bit less incomprehensible: https://xpqz.github.io/learnapl
skruger··on Python 3.11 vs 3.10 performance
Racket
skruger··on Conway's Game of Life in APL in Forth
I’ve written a few things on APL and K for the learner. Links here:

https://xpqz.github.io/about/

skruger··on Conway's Game of Life in APL in Forth
Try “Learning APL” —- https://xpqz.github.io/learnapl

Disclaimer: I’m the author

skruger··on K – A simple, fast vector programming language
If anyone is looking for some additional docs for ngn/k, I’ve written

https://xpqz.github.io/kbook

skruger··on Ask HN: What would you do with a million dollars today?
Burn it: https://www.gqmiddleeast.com/features/how-the-klf-burned-a-m...
skruger··on Mastering Dyalog APL (2009) [pdf]
I have written a gentle intro to APL: https://xpqz.github.io/learnapl
skruger··on Nial Array Language
Learn APL. Back to the roots. You’ll be pleasantly surprised. https://xpqz.github.io/learnapl
skruger··on Advent of Code 2021
For inspiration, here’s the full solution set for the 2015 edition in around 100 loc of k. Yes, all problems.

https://github.com/KxSystems/kdb/blob/master/ad.k

skruger··on APL in its modern state (2020)
It really isn’t. Thousands of APL programmers read it perfectly well. I can’t read Japanese, but that doesn’t make it lacking in “readability”.
← PreviousPage 2 of 3Next →