Publications by Jonathan Carroll
Iterative Square Root
I saw a toot celebrating a short, clean implementation of a square root finding algorithm and wanted to dig a bit deeper into how it works, with a diversion into some APL. This was the toot from Jim Gardner Doubly pleased with myself. Been doing the Tour of Go. Got to the section where you make a square root function, which should return once the ...
4544 sym Python (4541 sym/12 pcs)
I Patched R to Solve an Exercism Problem
With a serious yak shaving deviation, I have a really short “cheat” solution to one of the featured Exercism problems. It’s been a really insightful journey getting to this point, and as always I’ve learned a lot along the way. The fact that I was able to understand the required changes and propose them is thanks to the open-source nature o...
11067 sym R (8744 sym/22 pcs) 10 img
Advent of Array Elegance (AoC2023 Day 7)
I’m solving Advent of Code this year using a relaxed criteria compared to last year in that I’m allowing myself to use packages where they’re helpful, rather than strictly base R. Last year I re-solved half of the exercises using Rust which helped me learn a lot about Rust. This year I’m enamored with APL, and I wanted to share a particular...
11737 sym R (9794 sym/43 pcs) 8 img
Hooray, Array!
If you’re reading this hoping that I’m done with droning on about array-languages, close the tab… it only gets worse from here. If you thought APL was unreadable, even after my earlier blog posts, again – close button is right there. In this post I try out a brand new stack-based array language and continue to advocate for learning such thi...
8555 sym R (5695 sym/21 pcs) 6 img
Print Debugging (Now with Icecream!)
Print debugging has its place. Sure, it’s not always the best way to debug something, but it can often be the fastest. In this post I describe a useful way to do this in Rust and how we can get similar behaviour in R. I love the Rust dbg! macro – it wraps a value or expression and prints the result to help debug what’s happening in the middle...
3809 sym R (7838 sym/21 pcs)
Four Filters for Functional (Programming) Friends
I’m part of a local Functional Programming Meetup group which hosts talks, but also coordinates social meetings where we discuss all sorts of FP-related topics including Haskell and other languages. We’ve started running challenges where we all solve a given problem in a language of our choosing then discuss over drinks how they compare. This m...
7104 sym R (5899 sym/22 pcs)
Now You’re Thinking with Arrays
I keep hearing the assertion that “writing APL/Haskell/etc… makes you think differently” and I kept wondering why I agreed with the statement but at the same time didn’t think too much of it. I believe I’ve figured out that it’s because I happened to have been using Array-aware languages this whole time! It turns out R is an even better...
10920 sym Python (5912 sym/22 pcs) 6 img
Array Languages: R vs APL
I’ve been learning at least one new programming language a month through Exercism which has been really fun and interesting. I frequently say that “every language you learn teaches you something about all the others you know” and with nearly a dozen under my belt so far I’m starting to worry about the combinatorics of that statement. APL is...
12262 sym R (6507 sym/22 pcs) 2 img
Australian Signals Directorate 50c Coin Decryption
I took a very long time to post about the last Australian Signals Directorate (then DSD) decryption, so this time I’ll be a lot more punctual. This article was published today announcing that ASD have collaborated to release a new 50c coin containing a decryption challenge. The new ASD 50c coin That looks like fun! Typing in the letters and n...
2805 sym R (5704 sym/10 pcs) 2 img
Where for (loop) ARt Thou?
I’ve long been interested in exactly how R works – not quite enough for me to learn all the internals, but I was surprised that I could not find a clear guide towards exactly how vectorization works at the deepest level. Let’s say we want to add two vectors which we’ve defined as x and y x <- c(2, 4, 6) y <- c(1, 3, 2) One way to do this ...
5179 sym R (5023 sym/22 pcs)