This seems to me to be clearly a personal preference. When I think about identifiers I think about:
- Naming things whatever I want without following any kind of convention
- Camelcase
- Snake case
- Kebab case
- Are emojis supported? What about UTF-8?
I don’t see why using underscores is more correct than dashes. Yes, there is a historical preference for them, but that was born from a time when it wasn’t even clear that ASCII would be the character encoding of choice going forward. We aren’t restricted in the same way anymore.
Also, as I understand it, Typst isn’t aiming to reduce the learning curve for programmers. Some cherry-picked quotes from typst.app/home:
A more productive workflow for science.
For Rocket Scientists.
And the rest of us, too.
There is also this:
uses familiar programming constructs instead of hard-to-understand macros.
But that is directly contrasting Latex which I don’t think is written for programmers either.
I’d also like to point out that the character we are talking about has many uses. In the title of this post it is called a minus sign. I have also heard people call it a hyphen, a stroke, or a dash. The single character fulfills multiple roles. Yes, it’s a bit annoying that you can end up with something like #let x = num-a - 1
. The same character has two completely different uses. But that’s not the fault of Typst but of how (English) language uses that character (plus, how many characters do you want on your keyboard?).
Anyways, that’s my opinion on this non-critical aspect of a typesetting system that I enjoy using.
Edit: For completeness, the standard used by Typst is uax31 (source forum post by kevio).