Email or username:

Password:

Forgot your password?
mhoye

You (uninspired, bland, predictable): syntax highlighting with colours.

Me, (innovative, experimental, pushing the envelope): syntax highlighting with fonts.

50 comments
mhoye

Great news everyone I've just had the worst idea.

mhoye

Look, I'm just saying that in the end, all those people who said "if code is hard to write it should be hard to read" stepped to the threshold and turned away in cowardice. They never fully embraced their iconoclasm, could not will themselves to push their ideology to its logical conclusion. But here, today, I have lit the path they could not bring themselves even to set foot on.

Bring me Comic Sans, Papyrus, Impact, Curlz MT and Wingdings. If code was hard to write, it should hurt to see.

Mark Eichin

@mhoye
Now do this with APL as the base language...

FJ!!

@mhoye Back in the late 90s I set my terminal font to something whimsical like comic sans but actually readable, to trick my brain into not taking code as seriously as if I was reading a textbook. I thought it would make debugging easier because I subliminally would be more skeptical of what I was reading.

Honestly I think it worked.

Matthew Miller

@fj @mhoye

Comic sans for code that doesn't have test coverage.

Ben Zanin

@mhoye RENDER THE <BLINK> TAGS INSIDE SOURCE CODE YOU COWARDS

Rob Ricci

@mhoye this is a subtoot of that new github font isn't it

prozacchiwawa

@mhoye css classes should absolutely be significant in identifiers.

M. Tashbook

@mhoye Code mixed with Vogon poetry (at least, aesthetically)?

Tim @toolbear#spicy@ Taylor 🌻🇺🇦🇵🇸✊

@mhoye
I've been experimenting with minimal indentation, fully left-right justified, and trailing whitespace so that all lines are a constant length.

I think trying out worst ideas in an Oblique Strategies way is one of the best ideas.

mhoye

@toolbear fully left-justified is interesting, but…. I wonder what fully right justified feels like

Tim @toolbear#spicy@ Taylor 🌻🇺🇦🇵🇸✊

@mhoye
I've been using the LFSR from the game Pitfall as a practice problem. I keep starting from scratch every so often and see which stylistic and aesthetic choices I keep. Not unlike a painter doing many takes on a scene. In fact, this has been more an art therapy and meditative exercise than hobby coding. Or a mix.

Anyway, an example of some of the POSIX shell script implementing the Pitfall LFSR in the fully justified style. This one is 40 columns x 24 lines, so also organized in "blocks" or "cards", another arbitrary constraint I picked, inspired a bit by HyperCard). The intent is to homebrew a "notebook" coding style (think iPython / Jupyter notebooks) that I can use across any programming language (or config file or tiny DSL etc.).

It's slow going because it's art therapy, but it's also paying off when I tackle new things (like a Skyrim mod manager CLI in CMD.EXE batch script). I don't just think it's navel gazing, though it's also a lot of navel gazing on my part.

@mhoye
I've been using the LFSR from the game Pitfall as a practice problem. I keep starting from scratch every so often and see which stylistic and aesthetic choices I keep. Not unlike a painter doing many takes on a scene. In fact, this has been more an art therapy and meditative exercise than hobby coding. Or a mix.

Tim @toolbear#spicy@ Taylor 🌻🇺🇦🇵🇸✊

@mhoye (also attempting zero side effects, purely functional, purely deterministic, and using pattern matching instead of if-else conditionals, and anything else I think to add that frees me from ever having to actually finish one of these pieces of "art")

Tim @toolbear#spicy@ Taylor 🌻🇺🇦🇵🇸✊

@mhoye one reason the fixed, constant column width is something I'm curious about is that it would make right-justified (say, in a right-to-left language) look & feel just as normal as our left-justified, primarily written in English code does today.

A bunch of our tools have a lot of bias baked into them. Even the notion of "trailing whitespace" which is taken to mean "extra whitespace to the right of the last non-whitespace" and almost certainly isn't implemented in a right-to-left language neutral way.

So part of this is an exploration of the limits and biases of our software development tooling and common practices.

Enough infodumping for now. And also I think I did this to you several months back already :)

@mhoye one reason the fixed, constant column width is something I'm curious about is that it would make right-justified (say, in a right-to-left language) look & feel just as normal as our left-justified, primarily written in English code does today.

A bunch of our tools have a lot of bias baked into them. Even the notion of "trailing whitespace" which is taken to mean "extra whitespace to the right of the last non-whitespace" and almost certainly isn't implemented in a right-to-left language neutral way.

Lord Olle W

@mhoye Now make the fonts part of the language syntax for an extra level of enlightenment.

prom™️

@ollej @mhoye 𝓒𝓸𝓶𝓶𝓮𝓷𝓽𝓼 𝓶𝓾𝓼𝓽 𝓾𝓼𝓮 𝓱𝓪𝓷𝓭-𝔀𝓻𝓲𝓽𝓲𝓷𝓰.

Lord Olle W

@promovicz @mhoye 𝚄𝚜𝚎 𝚃𝚢𝚙𝚎𝚠𝚛𝚒𝚝𝚎𝚛 𝚏𝚘𝚛 𝚙𝚛𝚒𝚗𝚝𝚒𝚗𝚐

your auntifa liza 🇵🇷 🦛 🦦

@ollej @promovicz @mhoye y'all are really provoking me... i now need to make this happen

Lord Olle W

@blogdiva @promovicz @mhoye Do it! :)

Maybe different bold weights can indicate size of an int. The bolder the variable is, the more bits will be used for it.

mhoye

@ollej @blogdiva @promovicz arbitrary byte-length numbers but the number of bytes assigned is the number of n’s in “int”. Need an 8-byte integer? Easy, just declare an innnnnnnnt.

Lord Olle W

@mhoye @blogdiva @promovicz I love it! It’s so convenient! And so easy to read, just count the n’s.

mhoye

@ollej @blogdiva @promovicz I think we’re on to something here - maybe the way to easily express precision accuracy preferences is with the number of Os and As in “float”? If we only care about large numbers, declare a floooooaat but if you need precision in very small numbers, just declare a flooaaaaaaat.

Lord Olle W

@mhoye @blogdiva @promovicz Sounds incredibly practical! How about declaring the length of an array? How about out multiplying the number of a’s in the first position with the number of a’s in the second position?

aaaarraay = an array of length 8.

DELETED

@ollej @mhoye @blogdiva @promovicz one could write [int, int, int] as a type, at which point (int, int, int) and [int, int, int] read kind of similar and one might as well abandon fixed-size arrays in favor of tuples.

mhoye

@ollej @blogdiva @promovicz think of the convenience, how suddenly easy it is to declare an aaaaarraaaaay of floooooaaaats.

mhoye replied to mhoye

@ollej @blogdiva @promovicz tired: syntactic sugar. Wired: syntactic high-fructose corn syrup.

Lord Olle W replied to mhoye

@mhoye @blogdiva @promovicz Also, why only have ++ increment operator for adding one, just add more plus signs to increment with that amount. So +++ adds two and +++++ adds four.

Lord Olle W replied to Lord Olle W

@mhoye @blogdiva @promovicz Lets bring an end to the discussion of using keywords or braces for blocks, we can use this instead

dobegin{:

}end

And also requiring indentation with alternating tabs and spaces for each level of nesting.

your auntifa liza 🇵🇷 🦛 🦦

@mhoye @ollej @promovicz i ought to snitch on you to Eric Meyer (he's here but won't tag him because he doesn't need this nightmare scenario seared on his retinas)

Lord Olle W

@blogdiva @mhoye @promovicz Who is he? And why wouldn’t he want a nightmare scenario seared into his retinas?

Lord Olle W

@promovicz @mhoye The great thing about this is that we don’t need to prefix comments with // or # or anything. Just use that font and it will be ignored.

prom™️

Python code:

# make string [A ... B]
def crange(a,b):
s = ""
for c in range(ord(a),ord(b)+1):
s += chr(c)
return s

# some styles (see next post)
normal = crange('A','Z')+crange('a','z')
script_bold = crange('𝓐','𝔃')
monospace_normal = crange('𝙰','𝚣')

# translation function
def tostyle(s, style):
t = str.maketrans(normal,style)
return s.translate(t)

# demo
print(tostyle("TEST", monospace_normal))

@ollej @mhoye

Python code:

# make string [A ... B]
def crange(a,b):
s = ""
for c in range(ord(a),ord(b)+1):
s += chr(c)
return s

# some styles (see next post)
normal = crange('A','Z')+crange('a','z')
script_bold = crange('𝓐','𝔃')
monospace_normal = crange('𝙰','𝚣')

# translation function
def tostyle(s, style):
t = str.maketrans(normal,style)
return s.translate(t)

prom™️

More styles:

bold = crange('𝐀','𝐳')
italic_normal = "𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍𝑎𝑏𝑐𝑑𝑒𝑓𝑔𝑖𝑗𝑘𝑙𝑚𝑛𝑜𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑤𝑥𝑦𝑧"
italic_bold = crange('𝑨','𝒛')
script_norm = "𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵𝒶𝒷𝒸𝒹ℯ𝒻ℊ𝒽𝒾𝒿𝓀𝓁𝓂𝓃ℴ𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏"
double_normal = "𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫"
sans_normal = crange('𝖠','𝗓')
sans_bold = crange('𝗔','𝘇')
sans_italic = crange('𝘈','𝘻')
sans_italic_bold = crange('𝘼','𝙯')

@ollej @mhoye

More styles:

bold = crange('𝐀','𝐳')
italic_normal = "𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍𝑎𝑏𝑐𝑑𝑒𝑓𝑔𝑖𝑗𝑘𝑙𝑚𝑛𝑜𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑤𝑥𝑦𝑧"
italic_bold = crange('𝑨','𝒛')
script_norm = "𝒜ℬ𝒞𝒟ℰℱ𝒢ℋℐ𝒥𝒦ℒℳ𝒩𝒪𝒫𝒬ℛ𝒮𝒯𝒰𝒱𝒲𝒳𝒴𝒵𝒶𝒷𝒸𝒹ℯ𝒻ℊ𝒽𝒾𝒿𝓀𝓁𝓂𝓃ℴ𝓅𝓆𝓇𝓈𝓉𝓊𝓋𝓌𝓍𝓎𝓏"
double_normal = "𝔸𝔹ℂ𝔻𝔼𝔽𝔾ℍ𝕀𝕁𝕂𝕃𝕄ℕ𝕆ℙℚℝ𝕊𝕋𝕌𝕍𝕎𝕏𝕐ℤ𝕒𝕓𝕔𝕕𝕖𝕗𝕘𝕙𝕚𝕛𝕜𝕝𝕞𝕟𝕠𝕡𝕢𝕣𝕤𝕥𝕦𝕧𝕨𝕩𝕪𝕫"
sans_normal = crange('𝖠','𝗓')
sans_bold = crange('𝗔','𝘇')
sans_italic = crange('𝘈','𝘻')

aburka 🫣

@ollej @mhoye rust `unsafe` blocks must now be written in Chiller ITC

prom™️

@mhoye

Me (sane): proposing to use one font style per symbol.

Artists (inspired): using each font only once per symbol.

DELETED

@mhoye 15 years ago, it was even worse: sourceinsight.com/#syntax-fmt they seem to have cleaned it up a bit

schrotthaufen

@mhoye Thanks, my very vision impaired self hates it.

Guy

@mhoye
I'm still getting the chuckles pondering syntax highlighting for programming languages like WhiteSpace:

* off-white
* egg shell
* light tan
* cream colour

Les Orchard

@mhoye Finally my code will look as it feels: like it's holding me hostage for ransom

Go Up