Constructing and destructuring bytevectors using macros in Guile

One of Erlang’s cool features is the ability to match on binary patterns. This makes parsing binary data easier, more concise, and often more robust. One really cool egg I really enjoyed using with CHICKEN was bitstring, by rivo. It implements, inside of Scheme, a syntax for pattern matching on bitstrings, similar to Erlang. The documentation itself notes that the features are only a “subset of Erlang bit syntax.” That doesn’t stop it from being extremely useful.

CHICKEN's define-record in Guile

I am porting some code from CHICKEN to Guile. It’s been going pretty smooth overall, thanks to SRFIs and R5RS! One thing that CHICKEN has that Guile doesn’t is the define-record shorthand. It’s basically the same as the standard define-record-type except with less typing. For example: (define-record person name age) … acts like: (define-record-type <person> (make-person name age) person? (name person-name person-name-set!) (age person-age person-age-set!)) They aren’t exactly the same. define-record-type lets you change the names of or omit getters/setters/constructors/predicates.

A different perspective on price

It turns out I’m a lot less willing to spend $5 on an app when I think about how, with that money, I could buy 10 pounds of cabbage. Wait, cabbage? I guess cabbage is a weird unit of comparison, but cabbages were what I was looking at when the thought first struck me. I thought it’d be cool if I could come up with some more general way to compare the price of apps and other “luxury” goods to more basic necessities.

Who am I and how did I get here?

There’s something that’s always bothered me about my own problem-solving and reading or seeing the solutions of others. Namely, when I get that flash of insight required to finally see the strategy that works, where did that “flash” come from? How did I get there? A simpler version of this question bit me in middle school. I would often get stuck on one or two particular algebra problems in the set, and my dad would sit with me at the dinner table late into the night.

MBA vs MC

About the second week of college I decided my T430 was a bit too heavy to be carried around all the time. Linux’s (specifically ArchLinux) problems with WiFi networks1 and stability2 also began to annoy me to the point where I became worried I was wasting time — private college isn’t cheap! I’d long had an aversion to Apple products. Actually, perhaps it could be better characterized as a sort of anxiety.

Colorful Terminal Windows

It gets annoying sometimes having to read each window title after I Alt-Tab just to find the window I was trying to switch to. I can tell Openbox to temporarily raise the window I’m looking for, which makes it a little easier. But when I have lots of terminal windows with code that is all similarly highlighted, that approach doesn’t end up saving me much time. Looking more closely at Openbox’s Alt-Tab menu, I noticed that aside from the window title, the most visible element is the window’s icon.

Scraping fish names from Wikipedia with CHICKEN Scheme

Sometimes I need quick, memorable and fun names for projects or servers, especially for when I don’t have the time to come up with a creative name for a simple utility or library and just want something relatively unique so I can make a folder and start working. Obviously, the solution is to scrape fish names from Wikipedia and output them as suitable identifiers. :) I’m not sure how the Creative Commons license works with things in the public domain like names of fish.

Hello, world

Welcome to my blog! There isn’t anything here yet in the way of content or original CSS, but hopefully that will change soon. Stay tuned! (let ((cool-things '("code blocks & syntax highlighting" "python" "static site generators" "money saved"))) (for-each (lambda (subject) (print (format "time for ~a!" subject))) cool-things))