Workpad
Notes, ideas, and log entries for personal coding projects. The projects may not be public but the work will be.
Subscribe via RSS here

The Simplifications Paid Off

The UCL simplifications have been implemented, and they seem to be largely successful. Ripped out all the streaming types, and changed pipes to simply pass the result of the left command as first argument of the right. "Hello" | echo ", world" --> "Hello, world"This has dramatically improved the use of pipes. Previously, pipes could only be used to connect streams. But now, with pretty much anything flowing through a pipe, that list of commands has extended to pretty much every builtins and user-defined procs. Furthermore, a command no longer needs to know that it's being used in a pipeline:...

Simplifying UCL

I've been using UCL for several days now in that work tool I mentioned, and I'm wondering if the technical challenge that comes of making a featureful language is crowding out what I set out to do: making a useful command language that is easy to embed. So I'm thinking of making some simplifications. The first is to expand the possible use of pipes. To date, the only thing that can travel through pipes are streams. But many of the commands I've been adding simply return slices. This is probably because there's currently no "stream" type available to the embedder,...

Imports And The New Model

Well, I dragged Photo Bucket out today to work on it a bit. It's fallen by the wayside a little, and I've been wondering if it's worth continuing work on it. So many things about it that need to be looked at: the public site looks ugly, as does the admin section; working with more than a single image is a pain; backup and restore needs to be added; etc. I guess every project goes through this "trough of discontent" where the initial excitement has warn off and all you see is a huge laundry list of things to do. ...

Procs and Higher-Order Functions

More on UCL yesterday evening.  Biggest change is the introduction of user functions, called "procs" (same name used in TCL): proc greet { echo "Hello, world" } greet --> Hello, worldNaturally, like most languages, these can accept arguments, which use the same block variable binding as the `foreach` loop: proc greet { |what| echo "Hello, " $what } greet "moon" --> Hello, moonThe name is also optional, and if omitted, will actually make the function anonymous.  This allows functions to be set as variable values, and also be returned as results from other functions. proc makeGreeter { |greeting| proc {...

First Embed, and Optional Arguments

Came up with a name: Universal Control Language: UCL. See, you have TCL; but what if instead of being used for tools, it can be more universal? Sounds so much more… universal, am I right? 😀 Yeah, okay. It's not a great name. But it'll do for now. Anyway, I've started integrating this language with the admin tool I'm using at work. This tool I use is the impetus for this whole endeavour. Up until now, this tool was just a standard CLI command usable from the shell. But it's not uncommon for me to have to invoke the tool...

Lists, Hashs, and Loops

A bit more on TCL (yes, yes, I've gotta change the name) last night. Added both lists and hashes to the language. These can be created using a literal syntax, which looks pretty much looks how I described it a few days ago: set list ["a" "b" "c"] set hash ["a":"1" "b":"2" "c":"3"]I had a bit of trouble working out the grammar for this, I first went with something that looked a little like the following, where the key of an element is optional but the value is mandatory: list_or_hash --> "[" "]" # empty list | "[" ":" "]"...

Backlog Proc: A Better JQL

Backlog Proc is a simple item backlog tracker I built for work. I'd like to link them to Jira tickets, so that I know whether a particular backlog item actually has tasks written for them, and what the status of each of those tasks are.  I guess these are meant to be tracked by epics, but Jira's UI for handling such things is a mess, and I'd like to make notes that are only for my own eyes. Anyway, I'm was using JQL to select the Jira tickets. And it worked, but the language is a bit verbose. Plus the...

Tool Command Language: Macros And Blocks

More work on the tool command language (of which I need to come up with a name: I can't use the abbreviation TCL), this time working on getting multi-line statement blocks working. As in: echo "Here" echo "There"I got a little wrapped up about how I can configure the parser to recognise new-lines as statement separators. I tried this in the past with a hand rolled lexer and ended up peppering `NL` tokens all around the grammar. I was fearing that I needed to do something like this here. After a bit of experimentation, I think I've come up with...

Tool Command Language

I have this idea for a tool command language. Something similar to TCL, in that it's chiefly designed to be used as an embedded scripting language and chiefly in an interactive context. It's been an idea I've been having in my mind for a while, but I've got the perfect use case for it. I've got a tool at work I use to do occasional admin tasks. At the moment it's implemented as a CLI tool, and it works. But the biggest downside is that it needs to form connections to the cluster to call internal service methods, and it...