Oberon-WebReader - a basic web browser: Web.Mod

This example Oberon-07 program has been written to check the (client) functionality of the TCPNet.Mod module and the TCPNet Device in Oberon Workstation 1.3, and to serve as an example how the interface of TCPNet.Mod could be used.

The communication parts of the program, dealing with (simplified) HTTP/1.1, use approx. 125 lines of code, of which some 80 lines are spent on handling interactions with the TCPNet.Mod module, in the procedure Web.Client(). Much of the rest of the code (approx 600 lines) is spent on implementing a minimalist textual html browser (reader), and a few supporting "utility" procedures. Notably, a somewhat acrobatic scanner was implemented which can better deal with the hotchpotch of tokenizing habits in use in the html/web world.
Despite the minimalistic approach, the reader does have some text layout/styling behaviour, supports clickable hyperlinks, and supports multiple web pages in corresponding multiple viewers.


From a module size (Web.rsc is about the size of TextFrames.rsc) and resource usage perspective, this web reader could be further developed with many more features without running into Oberon Workstation limitations. However the text rendering noticeably taxes the speed of RISC5, compared to normal text display. It may be time for us to spend some optimization effort on the RISC5 instruction simulation, which has essentially not changed since we created it from scratch in 2015 from Wirth's 2-page description and the Lola-2 RISC5 definition. Network speed is not an issue, since the full transmission speed of the Mac's network interface can develop outside Oberon's RISC5 instructions.

As can be expected, the browser bypasses all scripting elements, and does not read CSS style-sheets (but does already have some infrastructure for cascading styles). Images are ignored, and not feasible with the current graphic capabilities of Oberon Workstation.
Another limitation is the lack of TLS, which prevents us from contacting https sites. Unfortunately, http is discouraged today by the dominant companies. Some consumer browsers mark http pages conspicuously as "not secure", even when this form of security is not required for typical non-interactive sites.
Still, with all its limitations, we found this little browser exciting to see at work, invoking a feeling as when the Web was just invented. It also makes us realize that many small and novel types of programs and lightweight protocols (i.e. much simpler than http and html) could be conceived and quickly realized.

The program can be downloaded here. It requires the latest version of Oberon Workstation: v1.3.1, for the network module, and also for the latest version of Texts.Mod, in which Wirth improved the notification behavior, and in which we included a fix in Texts.Save (which could otherwise lead to a corruption in the text system if Save is called with zero-length stretches of text).
Other Project Oberon 2013 systems could use this module if a behavioral equivalent of the interface of TCPNet.Mod can be created.
There is a command called Web.OpenHTML to open a local .html file from your Oberon directory, without needing the network; in that case (if you don't have Oberon Workstation) you should comment out all references to TCPNet.Mod, or provide a dummy TCPNet module.

To obtain addresses of non-https sites, you could still use Google (with https in your regular browser): they are providing a search modifier (-inurl:https) to look for non-https sites.
An example site that works pretty well for reading with Web.Mod is the ETH Oberon mailing list at (see picture).