A minimalist hypertext browser

Here’s the “markup language” I mentioned in a comment to @Bosmon:

https://akkartik.name/post/luaML2

4 Likes

This reminds me a lot of the Help Browser in Squeak and Pharo Smalltalk. The common point is encoding rich text using the features of the language.

My own attitude towards this approach is ambivalent. I have used this approach for scientific data in the past, storing a database as Python code snippets. Very powerful, in a very simple implementation, but I wouldn’t do it again, at least for that use case. Inevitably, users of my code (including myself) ended up collaborating with users of different software and wanted to share data with them. If the data has a baked-in dependency on Python plus a few Python libraries, that’s difficult.

Another counterargument is the Rule of Least Power. You are not violating it as long as you restrict yourself to passive Lua data structures. But unless you build a validator for this into your browser (more code!), you will one day succumb to the temptation of generating text by Lua code rather than entering it as literals. And then your documents have Lua as a dependency.

2 Likes

I ended up overhauling the representation of color in this browser. The new scheme:

  • Colors are represented in Oklch space, with a hue, a chromatic intensity and a lightness.
  • While background colors need to provide all 3 dimensions, foreground colors are not required to. You can provide just a hue, or just hue+intensity. The browser will pick missing dimensions for you while ensuring a minimum level of contrast.

Here’s a test run where each page load randomizes the background color but the foreground color specs are constant.

1 Like