2024 eclipse timelapse by Ashley Lian

Programming

Come back later for a finished page. - Sean ☶

Python

Python is my daily driver, my go-to for getting things done quickly and to have fun while doing it. For the first time, in my professional career I've recently 02Z07 discovered that a good day is one where I get to program. Up until this point, I had seen programming as a tool, a way to make a living, or a means to a degree. But I see now it's much more than that, and I am so very glad that it has turned out this way. I love solving problems with code: writing a quick script to help edit photos, refactoring a flagship machine learning codebase for a multi-million dollar company, exploring the limits of my knowledge. The more I program the more I find comfort in the struggle of programming something difficult or new. I love that I can hit a wall, get frustrated, and come back to the same wall the next day and discover a little keyhole down by my knees that I had missed the day before. Then I only need to brush aside some overgrown moss and dusty github issue posts to fashion a makeshift key, and the hidden doorway swings open for me.

Maude

Maude is based on rewriting logic, where computations are performed by applying rewrite rules to transform terms into other terms. It is often used in academic and research contexts for tasks like protocol verification, theorem proving, and system modeling.

As someone who is a self-taught Python programmer, I initially found it quite difficult to dissect and understand the fundamentals of Maude. I've found this analogy to be useful: think of Maude's rewrite rules as similar to Python's if statements combined with transformations.

Imagine a traffic simulator, complete with car movement based on the state of traffic light colors. In Python, I might write code that checks the state of the lights and updates the cars' behavior accordingly:

    if traffic_light == "green":
        car.move_forward()
    elif traffic_light == "red":
        car.stop()

In Maude, a rewrite rule accomplishes something similar but works as a "universal traffic controller" that watches the state of the entire system and updates it according to predefined rules. Instead of explicitly calling methods like in Python, the rules automatically fire when their conditions are met. A rewrite rule in Maude to this effect may look like:

    rl [move-car] : < car : Car | state: stopped > < light : TrafficLight | state: green >
                    => < car : Car | state:moving > < light : TrafficLight | state: green > .

This means: If there is a car that is stopped at a light that is green, rewrite the system state such that the car is moving.