Advent of Code 2022
Posted on November 28, 2023
| 34 minutes
| 7175 words
| Jonathan Carroll
| Link to source
In the lead up to Christmas each year, Advent of Code
offers a series of 25 puzzles which start out reasonably simple, but get progressively harder, eventually requiring knowledge of algorithms and dynamic programming techniques. Last year
I solved these in (strictly) base R on the day they were released (or as close to as
I could). I then (starting Dec 27) went back and re-solved (13 of) them in Rust.
This post details what I learned along the way and some fun visualisations I made.
[Read More]
Print Debugging (Now with Icecream!)
Posted on November 7, 2023
| 9 minutes
| 1804 words
| Jonathan Carroll
| Link to source
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.
[Read More]
Hooray, Array!
Posted on October 9, 2023
| 11 minutes
| 2279 words
| Jonathan Carroll
| Link to source
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 things.
[Read More]
Taking from Infinite Sequences
Posted on August 18, 2023
| 13 minutes
| 2634 words
| Jonathan Carroll
| Link to source
One thing that has really caught my attention as I learn more programming
languages is the idea of generators or infinite sequences of values. Yes, infinite.
Coming from R, that seems unlikely, but in at least several other languages,
it’s entirely possible thanks to iterators and lazy evaluation.
[Read More]
Pythagorean Triples with Comprehensions
Posted on August 13, 2023
| 13 minutes
| 2736 words
| Jonathan Carroll
| Link to source
I’ve been learning at least one new programming language per month through Exercism and the #12in23 challenge. I’ve keep saying,
every time you learn a new language, you learn something about all the others
you know. Plus, once you know \(N\) languages, the \(N+1^{\rm th}\) is significantly easier. This
post covers a calculation I came across in Haskell, and how I can now do the same
in a lot of other languages - and perhaps can’t as easily in others.
[Read More]
Argument Matching Across Languages
Posted on August 6, 2023
(Last modified on August 20, 2023)
| 16 minutes
| 3270 words
| Jonathan Carroll
| Link to source
With Functional Programming, we write functions which take arguments and do something with
or based on those arguments. You might not think there’s much to learn about given that
tiny description of “an argument to a function” but the syntax and mechanics of different
languages is actually widely variable and intricate.
[Read More]
Reflecting on Macros
Posted on June 10, 2023
(Last modified on June 17, 2023)
| 12 minutes
| 2519 words
| Jonathan Carroll
| Link to source
I’ve been following the drama of the RustConf Keynote Fiasco (RKNF, per @fasterthanlime)
from a great distance - I’m not involved in that community beyond starting to learn
the language. But the controversial topic itself Compile-Time Reflection seemed like something interesting I could learn something about.
[Read More]
Polyglot Exploration of Function Overloading
Posted on April 3, 2023
(Last modified on June 17, 2023)
| 9 minutes
| 1859 words
| Jonathan Carroll
| Link to source
I’ve been working my way through Exercism exercises in a variety of
languages because I strongly believe every language you learn something about teaches
you about all the others you know, and makes for useful comparisons between what
features they offer. I was Learning Me a Haskell for Great Good
(there’s a guide/book by that name) and something about Pattern Matching
just seemed extremely familiar.
[Read More]
Polyglot Sorting
Posted on October 8, 2022
(Last modified on June 17, 2023)
| 14 minutes
| 2858 words
| Jonathan Carroll
| Link to source
I’ve had the impression lately that everyone is learning Rust and there’s plenty of great material out there to make that easier. {gifski} is perhaps the most well-known example of an R package wrapping a Rust Cargo crate. I don’t really know any system language particularly well, so I figured I’d wade into it and see what it’s like.
[Read More]