Programming Leftovers
-
Modus Create LLC ☛ A hundred pull requests for Liquid Haskell
Liquid Haskell is a tool to verify Haskell programs. We can write formal specifications inside special Haskell comments {-@ ... @-}, and the tool will check whether the program behaves as specified. For instance, the following specification of the filter function says that we expect all of the elements in the result to satisfy the given predicate.
-
Bartosz Milewski ☛ Subobject Classifier
We have seen how topology can be defined by working with sets of continuous functions over coverages. Categorically speaking, a coverage is a special case of a sieve, which is defined as a subfunctor of the hom-functor C(-, a).
We’d like to characterize the relationship between a functor and its subfunctor by looking at them as objects in the category of presheaves. For that we need to introduce the idea of a subobject.
-
The New Stack ☛ Python's Built-In String Tools Every Developer Needs
Strings are one of the first concepts taught in programming because they are fundamental to handling data. Whether working with structured or unstructured formats, the underlying content is often represented as strings. Not only are strings everywhere — they’re here to stay. They are deeply embedded in datasets and communication protocols, making them an essential part of modern computing. Below are some common areas where data is represented as strings: [...]
-
[Old] Aidan Cully ☛ Communicating With Code: Sources of Accidental Complexity
So we want to reduce accidental complexity. Which requires identifying accidental complexity. This is subjective - the perception of complexity will vary by observer (I wrote about my experience here), and the same observer will perceive the same code as differently complex at different times. It will often be the case that two types of accidental complexity will be in opposition to each other: reducing accidental complexity of type A results in accidental complexity of type B, and reducing complexity of type B results in complexity of type A. So this will be a balancing act, and choosing the right balance means knowing your audience.
-
Perl / Raku
-
Fuzzix ☛ Building the Second-Worst ZX Spectrum Emulator in the World with Perl
I've always been interested in the idea of building a small computer emulator, but it always seemed to be within the realms of bizarre science experiment meets arcane magic trick. Software-defined silicon chips, talk of "precise timings" or "t-state accuracy", translating keyboard/mouse/disk/etc. I/O, wondering how you turn the flapping of a bit on a port into something that beeps on modern audio hardware, and so on. It all seemed a bit intimidating, and other things held my interest.
I got thinking about this again recently, with a desire to produce interesting things for the ZX Spectrum Next, so I thought "I wonder how far I can get with a Perl script?" Perl's super power is whipuptitude - the ability to draw on expressive language features and available libraries on CPAN to solve annoying problems and get things done - you can quickly whip things up. Can I "whip up" a speccy emulator in Perl?
-
-
Python
-
Raymond Camden ☛ Geolocating a Folder of Images with Python
I'm not sure how useful this will be, but as I recently built it in another language (I plan on blogging that soon as well), I thought I'd take a stab at building it in Python. Given a folder of images, can I use Python to grab the Exif information and then using that, figure out where the photos were taken using a reverse geocoding service? Here's what I built.
-
-
Golang
-
University of Toronto ☛ Go's choice of multiple return values was the simpler option
Yesterday I wrote about Go's use of multiple return values and Go types, in reaction to Mond's Were multiple return values Go's biggest mistake?. One of the things that I forgot to mention in that entry is that I think Go's choice to have multiple values for function returns and a few other things was the simpler and more conservative approach in its overall language design.
-
Carlos Becker ☛ Custom YAML marshal/unmarshal with Go
As a maintainer of GoReleaser, I try to avoid breaking changes.
One thing that came up a couple of times is a configuration field that was a string, but now needs to be a []string.
I could of course just change it to []string, but would break anyone using it as a string still.
-
-
Rust
-
Rust Weekly Updates ☛ This Week In Rust: This Week in Rust 591
Hello and welcome to another issue of This Week in Rust!
-