One of the nice little things about Julia programming has been the broad support for Unicode identifiers — variables like α̂₂′ and operators like ⊕. However, a common source of frustration is the paucity of available subscripts and superscripts — there is no superscript “q” or subscript “A”, much less superscript “*” or “†”, in Unicode.
On the back burner for a few years now, a few of us have been bouncing around the idea of proposing that Unicode expand its set of subscripts and superscripts by adding new “mathematical sub/superscript” combining characters. See our draft proposal here, which is now nearing the the point of formal submission: https://github.com/stevengj/subsuper-proposal
One sticking point is that proposals are required to include the name and contact information for a company or individual who would agree to provide a computerized font (True Type or PostScript) for publication of the standard. Can we crowdsource this?
Basically, we need to find volunteers with font-design experience, who, if the proposal is accepted, will create font with the needed characters. In principle, this is as simple as taking a free font like DejaVu Sans Mono, making sub/superscript versions of 100–150 common mathematical glyphs (Latin and Greek characters and a few other symbols), and then adding ligatures so that the new glyphs are used when the corresponding character+combining-character combination is encountered.
By the way, all the superscripts and subscripts mentioned in Professor Johnson’s proposal are currently available in the JuliaMono font; they live in a Private Use Area, starting at 0xf0000.
You can display them in string form with:
for c in 0xf0000:0x20:0xf011f
print("$(string(c, base=16)) ")
for c1 in c:c + 0x1f
print("x$(Char(c1)) ")
end
println()
end
Of course, this isn’t useful if you want to see your code in its full glory on Github, or indeed anywhere else unless the same font is active. And you can’t use them in Julia variable names, either, because … they’re not valid Unicode glyphs.