Abnormal programming
JavaScript
Programming
HTML
Browsers
6 August

On the way to durable applications with PSKOV static site generator as an example

Original author: Михаил Капелько
Translation

Pskov's veche


Hi, my name is Michael Kapelko. I have been developing software professionally for more than 10 years. I develop games and game development tools in my spare time.


This article describes my first durable application for desktop PCs: PSKOV static site generator.


Durability


A durable application is an application that functions without a single change on operating systems released in years 2010-2030. In other words, a durable application has backward compatibility of 10 years and has the stability to run for 10 years. Actually, PSKOV runs even under Windows 2000, so PSKOV has backward compatibility of 19 years.


From technical side, PSKOV is a single HTML file with layout (HTML), styles (CSS), and code (JavaScript) packed inside. PSKOV runs strictly inside a web browser without connecting to any server.


Such an implementation gives PSKOV the following features:


  • it can be copied without restrictions
  • it can be hosted anywhere
  • it can run locally
  • it can operate without Internet

I can't guarantee stability for 10 years because I can't control the future. However, the history of HTML, CSS, and JavaScript evolution tells us these technologies are developed with maximum backward compatibility. First, new JavaScript features leave older ones still working. Second, web browser developers are interested in making their web browsers work with as many web sites as possible. For example, <center> tag, being declared deprecated in 2014, still works as expected 5 years since, in 2019.


At the same time, each web browser application has a serious restriction called sandbox, a deceptive name for a cage. The cage prevents access to both local file system of users and almost any Internet resource without its owner's explicit permission (CORS). As a result, the application can only communicate with users either through the distinct server, or by offering files to download manually. Downloading files one by one or as an archive is inconvenient, that's why nowadays server oriented approach reigns the world. I'll touch problems of that approach in a moment.


To free PSKOV from the cage, LFSA was created, a tiny Python script that needs to be run manually while PSKOV is running. LFSA allows PSKOV to access the user’s local file system. Python was selected because Linux and macOS have Python installed by default, and users can easily install Python on Windows (even Windows 2000).


Track record


PSKOV has been successfully used to create the following small sites:



Now let's see why PSKOV was created as a durable application for web browsers.


Reason №1: collect and keep knowledge in an accessible form


I have been creating convenient game development tools for several years now. So far the collected knowledge was represented by native applications for desktop PCs, education articles for related technologies, and showcase videos. Such forms of the collected knowledge are basically dead:


  • few would download an unknown application
  • few would watch some videos
  • even fewer would read some articles

In many ways, this death is due to inaccessibility: one has to make an unknown amount of effort to achieve an unknown result. Hardly anyone would have interest in this. A web browser application, potentially accessible anywhere, is a totally different deal: you only need to make a known effort, click a link, to achieve an unknown result. The history of conducting twitter revolutions proves that almost anyone can open a link and "like" the change of a "bloody regime".


Reason №2: rule by people


Nowadays any Internet activity is performed by the means of services that almost always belong to some company: messages, maps, search, music, source code, etc. Such power usurpation leads to shutdowns of services that their owning companies deem unprofitable. They usually do it without any consent with those users who brought life to these services in the first place.


Other times companies simply block competing browsers from accessing their service, as it was recently the case with the web version of Skype. Luckily there are people who don’t agree with such politics. Thanks to them, unlocking tools appear.


As for me, I deem such a way of handling things as inappropriate. However, savage business is not the only one to blame here; average users, every one of us is guilty, too. You may argue that users have no choice, that someone else (government, aliens, underline what you like) made this world unfair. Some people even blame government/aliens directly and believe that without them, life would be amazing. However, human history tells us a different story: "the state is not some enemy horde that occupied the society, but that which grows out of society and mirrors it".


Being part of the people, I decided to start with myself and use my power for the best: create applications that I need in such a way to make them usable and accessible to everyone everywhere. PSKOV is the first attempt, which already exceeded my expectations. Sure, PSKOV has limitations like LFSA and unencrypted HTTP; there's a lot to do to increase the accessibility of PSKOV, however, I'm ready to dare anyone: current PSKOV version will keep functioning for 10 years to come without any maintenance.


That's it for describing my first durable application for desktop PCs: PSKOV static site generator.


+7
353 1
Leave a comment
Top of the day