Re:Show HN: HyTags – HTML as a Programming Language
by dhamidi on Wednesday January 14, 2026 @02:55PM
(#46621980)
Maybe useful inspiration from TCL: there are many commands that define new variables, which makes modeling the stack unnecessary.
For example:
lappend responses [dict status 200 body ...]
Appends a new dict to the list held in the variable responses, creating the variable if necessary.I can see that being an attribute:
<request-send url="..." as="greeting" />
<response-text response="greeting" as="text" />
<selection-set-text text="text" />
Re:Show HN: HyTags – HTML as a Programming Language
by lassejansen on Wednesday January 14, 2026 @03:04PM
(#46622186)
The main reason for using a stack was reducing verbosity because for short scripts using variables felt unnecessary when the type-prefix of the command already communicates the variable contents. But it could still be a good idea to have a shorter syntax for assigned variables.
Accessing a variables works like this at the moment:
<selection-set-text $text="varname">
Keeping the dollar syntax, setting the return value to a named variable could look like this: <response-get-text $="varname">
You certainly must get used to the stack based approach. I tried to make it more approachable by making stack lookups type based (automatic search for value with matching type) and by using type-prefixed commands, e.g.