Ricco’s taken an interest to my shoes today. Ivy, despite trying to come off as her own bird when it comes with dealing with Ricco, couldn’t help taking an interest too. 🦜

Auto-generated description: Two cockatiels with distinct plumages are perched on a person's shoe, which rests on a textured carpet.

Devlog: UCL — More About The Set Operator

I made a decision around the set operator in UCL this morning.

When I added the set operator, I made it such that when setting variables, you had to include the leading dollar sign:

$a = 123

The reason for this was that the set operator was also to be used for setting pseudo-variables, which had a different prefix character.

@ans = "this"

I needed the user to include the @ prefix to distinguish the two, and since one variable type required a prefix, it made sense to require it for the other.

I’ve been trying this for a while, and I’ve deceided I didn’t like it. It felt strange to me. It shouldn’t, really, as it’s similar to how variable assignments work in Go’s templating language, which I consider an inspiration for UCL. On the other hand, TCL and Bash scripts, which are also inspirations, require the variable name to be written without the leading dollar sign in assignments. Heck, UCL itself still had constructs where referencing a name for a variable is done so without a leading dollar sign, such as block inputs. And I had no interest in changing that:

proc foo { |x|
    echo $x
}

for [1 2 3] { |v| foo $v }

So I made the decision to remove the need for the dollar sign prefix in the set operator. Now, when setting a variable, only the variable name can be used:

msg = "Hello"
echo $msg

In fact, if one were to use the leading dollar sign, the program will fail with an error.

This does have some tradeoffs. The first is that I still need to use the @ prefix for setting pseudo variables, and this change will violate the likeness of how the two look in assignments:

@ans = 123
bla = 234

The second is that this breaks the likeness of how a sub-index looks when reading it, verses how it looks when it’s being modified:

a = [1 2 3]
a.(1) = 4
$a
--> [1 4 3]
$a.(1)
--> 4

(One could argue that the dollar sign prefix makes sense here as the evaluator is dereferencing the list in order to modify the specific index. That’s a good argument, but it feels a little bit too esoteric to justify the confusion it would add).

This sucks, but I think they’re tradeoffs worth making. UCL is more of a command language than a templating language, so when asked to imagine similar languages, I like to think one will respond with TCL or shell-scripts, rather than Go templates.

And honestly, I think I just prefer it this way. I feel that I’m more likely to set regular variables rather than pseudo-variables and indicies. So why not go with the approach that seems nicer if you’re likely to encounter more often.

Finally, I did try support both prefixed and non-prefixed variables in the set operator, but this just felt like I was shying away from making a decision. So it wasn’t long before I scrapped that.

Day 14: twilight

#mbjune

Auto-generated description: A cityscape at sunset features tall buildings silhouetted against a colorful sky with clouds and a sun dipping below the horizon.

I think I may need to write more long form. It’s easy to dash out a small thought or two like this. It’s quite different trying to organise your thoughts into something larger. Different muscles are being exercised, and it feels like mine have atrophied a little.

Some Morning AI Thoughts

Some contrasting views on the role of AI in creation, highlighting the importance of human creativity and quality over speed and cost-cutting in technological advancements.

Day 13: pathway

#mbjune

Auto-generated description: A winding path meanders through a forested area with sparse vegetation and slender trees.

Hello there. 🦜

Auto-generated description: A close-up of a cockatiel with a grey body, white wing patches, and orange cheeks perching on someone's shoulder. A white cockatiel is looking at pencil-drawn portrait of itself framed in wood, with a small red heart sticker in the corner.

I must admit, I was not expecting much when I plugged my iPad into a HDMI and USB hub splitter. Yet I was pleasantly surprised that it had no trouble extending (well, mirroring) the display and enabling keyboard and mouse. It’s not perfect, but it’s better than I was expecting.

Auto-generated description: A workspace with a dual-monitor setup displaying code, featuring a laptop on puzzle boxes, a keyboard, a mouse, and a mug.

Day 12: hidden

#mbjune

Fog partially obscures a cityscape view from a high vantage point, with modern buildings and a river visible beneath a clear blue sky.

If ute is short for “utility” vehicle, then instead of SUV, we should be calling these vehicles “sports utes”.

🔗 Robert Birming: Blog Inspiration

Very nice collection of links to blogging resources — from ideas and inspirations through to colour and icon packs — from @birming. This stuff is cat nip for me, so I’m sure to enjoy browsing these links.

Speaking of avians, I’m back in Canberra, which can only mean one thing: there will be photos of cockatiels.

A person is sitting on a couch with two cockatiels on their chest and shoulder.

Every cafe or eatery at the airport uses an avian or aviation theme. Here’s a way to stand out: nautical theme. Having a fish and chip shop with boats and lighthouses will turn heads.

🔗 You’re not a front-end developer until you’ve… - Nic Chan

Scored 17 in this little quiz. Not bad for a backend developer, although many of the questions universally apply.

Via: Jim Nielsen’s Notes

Day 11: brick

Might be pushing the definition of “brick” for this one. #mbjune

Auto-generated description: A brick building stands behind a stone wall and cobblestone street.

🔗 Science: Cockatoos have learned to operate drinking fountains in Australia

Each placed one or both of its feet on the fountain’s twist handle, then lowered its weight to twist the handle clockwise and prevent it from springing back up.

Amazing.

Oh, no

Image 114655769504691129 from toot 114655769811474950 on mastodon.social

Apple, I was kidding.

Looking forward to all the fun new permission gates that will show up in MacOS Tahoe. “Your keyboard is trying to use a process on your computer. Keyboards are known to result in modifications to your personal data.” 😛

Day 10: rail

I post a lot of train photos on this site, so here’s one of the other railed vehicles I encounter. #mbjune

A tram approaches an intersection at first light, reflecting light off wet pavement.

That Which Didn't Make the Cut: a Hugo CMS

You’ve probably noticed1 that I’ve stopped posting links to Open Bookmarks, and have started posting them here again. The main reason for this is that I’ve abandoned work on the CMS I was working on that powered that bookmarking site. Yes, yes, I know: another one. Open Bookmarks was basically a static Hugo site, hosted on Netlify. But being someone that wanted to make it easy for me to post new links without having to do a Git checkout, or fiddle around YAML front-matter, I thought of building a simple web-service for this.

I don’t want to say too much about it, other than I managed to get the post functionality working. Creating a new link post would involve fetching the page, and pre-populating the link and optional via link with the fetched page title. I’d just finish the post with some quotes or quips, then click Post. That’ll save the post in a local database, write it to a staged Hugo site, run Hugo to generate the static site, and upload it to Netlify. There was nothing special about link posts per se: they were just a specialisation of the regular posting feature — a template if you will — which would work the same way, just without the pre-fills.

The other thing I added was support for adding arbitrary pages. This was a dramatic simplification to what is possible in Hugo, in that only one page bundle was supported. And it was pretty compromised: you had to set the page title to “Index” to modify the home page. But this was enough for that, plus some additional pages at the top level.

One other feature was that you can “preview” the site if you didn’t have a Netlify site setup and you wanted to see the Hugo site within the app itself. I had an idea of adding support for staging posts prior to publishing them to Netlify, so that one could look at them. But this never got built.

Finally there were some options for configuring the site properties. Uploads were never implemented.

Here are some screenshots, which isn’t much other than evidence that I was prioritising the backend over the user experience:

So, why was this killed? Well, apart from the fact that it seemed like remaking prior art — I’m sure there are plenty of Hugo CMSes out there — it seemed strange having two systems that relate to blogging. Recognising this, I decided to add this functionality to Blogging Tools:

This can’t really be described as CMS. It’s more of a place to create posts from a template which can then be published via a Micropub endpoint. But it does the job I need, which is creating link posts with the links pre-filled.


  1. Or not. I mean, I’m not expecting you to notice. You’ve got lives of your own, after all. ↩︎