Greetings! I’ll be using this space to write about technical things, mostly revolving around my hobby, the Dylan programming language.
Since I’ll be mostly writing about geeky Dylan stuff, let’s see if my website software, Hugo, knows how to highlight Dylan code. It should, since I added a Chroma lexer for it.
|
|
Hmm. Needs work. I’d like to see three things in a code highlighter:
-
Highlight new bindings. Wherever a new variable/function/class/etc name is introduced, it should be highlighted.
-
Highlight unusual flow of control. Any non-local exit, like
return
,signal
,error
should stand out. -
I think a different color for comments (and perhaps strings) does help to orient me when I’m paging through code quickly, so this can be useful.
In the above code this would mean highlighting <point>
, *everything*
,
"everything"
(but not in red), the first three instances of factorial
, and
the comments. If you’re reading this in the future, and I’ve done my job well,
that’s what you’ll see.
It’s common for syntax coloring themes to make everything a different color. “We know this is a type so we’ll make it yellow. We know this is a number so we’ll make it blue.” To me this removes the usefulness of the highlighting in the first place. If every syntactic element is a different color the color ceases to carry useful information.
That’s all for now…