YAMLScript Firsts

by Ingy döt Net | | 3 min read

Remember Your First Time?

Do you remember the first time you wrote a program in a new language? For YAMLScript, mine was yesterday!

This is my first post of 2024. I've been working on YAMLScript non-stop since the last YAMLScript Advent 2023 post. Too busy to write a blog post, I guess.

Yesterday something awesome happened.

Putting out a YAMLScript release is a complicated process. It takes me about an hour to do it. Of course I plan to automate it fully but I just haven't had the tuits.

For the last several releases, I've had a text file that listed all the steps so that I wouldn't forget anything. Yesterday I automated that list...

...you guessed it...

...in YAMLScript!

The 10 Step Program

Of course I have been writing test programs in YAMLScript for a while now. This was the first time that I wrote a YAMLScript program that actually does something I need to do on a regular basis.

Without further ado, here is the YAMLScript Release Automation Program.

It's a 10 step program that does everything I used to do manually. I think it turned out pretty nice.

Judge for yourself but let me tell you a bit about it first.

  • There are 10 steps to perform.
  • If a step fails you can run it again.
  • You can indicate which steps to start and end at.
  • Reports information about each step as it goes.
  • Has a verbose mode that shows you what it has done to various files.
  • Has a dry-run mode that shows you what it would do without doing anything.
  • Validates its inputs and tries to doublecheck its work.
  • Everything is broken up into short and simple functions.
  • Execution starts with the main function at the top.
  • Shells out to common CLI commands to get things done.
  • Uses multiline literal scalars with interpolation to make changelog entries.
  • Fairly well documented internally with comments.

It's pretty much like a shell script, but written in YAMLScript. Given that YAMLScript is a functional language with immutable data, perhaps it's more reliable than a shell script. Time will tell.

I also added a Makefile rule to run the program. It supports several variables to control the program and writes the output to stdout and a log file.

Here's the output from a dry-run:

$ make release-yamlscript o=0.1.42 n=0.1.43 v=1 d=1
./util/release-yamlscript 0.1.42 0.1.43 2>&1 | tee -a release-0.1.43.log

Releasing YAMLScript v0.1.43 at Thu Mar 14 07:28:19 AM PDT 2024


Step 1) Update '.version.sh' file
+ git -P diff .version.sh

Step 2) Run 'make bump'
+ make bump
+ git -P diff

Step 3) Update the 'Changes' file
+ grep -F -B999 '0.1.42' Changes

Step 4) Update the Change Log files for the binding modules

Step 5) Commit the release changes to git
+ git commit -a -m 'release: 0.1.43'

Step 6) Add git tag for the new version
+ git tag 0.1.43

Step 7) Push the git commit and tag
+ git push
+ git push --tags

Step 8) Run 'make release'
+ make release

Step 9) Run 'make release' for each language binding library
+ make -C clojure release
+ make -C go release
+ make -C java release
+ make -C julia release
+ make -C nodejs release
+ make -C perl release
+ make -C perl-alien release
+ make -C python release
+ make -C raku release
+ make -C ruby release
+ make -C rust release
+ git -P diff

Step 10) Publish the yamlscript.org website
+ make -C www realclean publish

Maybe it's time for you to write your first YAMLScript program!

If you do, drop me a line and tell me how it went. YS is still a young language and I'm always looking for feedback.

Other Firsts

Last Monday someone published the first article about YAMLScript.

It was based on YAML core team member Tina Müller's recent talk about YAML at the FOSDEM 2024 which had a section about YAMLScript.

The article was accurate and well researched which is a rare thing for YAML in my experience.

Also last week I gave the first 2024 public talk about YAMLScript at the Seajure Meetup in Seattle. Seajure is a Seattle based Clojure meetup that I started attending last year. The talk was well received and I got some good feedback. The video should be available soon.

Next month YAMLScript will be presented at its first conference talk of 2024 at the Linux Foundation's Open Source Summit North America. I hope to see you there!

Future Firsts

There's a few big things in the works for YAMLScript this year worth mentioning:

  • A YAML Schema DSL that will be used to validate YAMLScript evaluation results.
  • Compiler source maps for IDE integration and better error messages.
  • YAMLScript User Documentation (finally).

I'll be back here next week to tell you about all the things that have happened with YAMLScript in the last 3 months. So much good stuff. Stay tuned!

YS We Can! — Ingy döt Net