One of the more intimidating constructs available as a J primitive is the dyad
also known as Sequential Machine.
This is kind of an oddball compared to the rest of J's primitives.
Instead of taking a regular array as its left argument, it takes a boxed list of several different things (paraphrased):
- function code
- state/action table
- machine specification
- control flags
Perl-compatible regular expression verbs are part of the standard library, so why does J provide similar functionality? One reason might be flexibility: sequential machine, unlike regex, can be used on arrays of any type (not just strings). However, I suspect the real reason is that J's authors feel that regex is a superfluous thing, and only include it based on popular demand.
Write a script which transforms (my preferred subset of) Markdown into HTML, and bundle it with my static site generator which builds this website. Note that writing the script is the main goal, as there are plenty of Markdown-to-HTML conversion tools already.
First I found the most-used tags on my site:
This gave me a starting point for which tags would benefit most from more ergonomic markup.
Some of it is noise (html/head/body tags are auto-generated), but there are some good candidates for automation up at the top, especially link and paragraph tags.
Step 1: links
To begin, I will first write a sed-like script which only replaces
[text](href)-style Markdown links with their respective HTML. The first pass will use regex since I'm much more comfortable with that syntax, and the second pass will use
;:. To be continued...