git.alexw.nyc home about git garden
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
<h1>Simple web applications</h1>

Building for the web is enormously complex, and I'm trying to understand what
it would look like to build web applications that are intentionally designed
for simplicity and sustainability. This means thinking not just about how easy
it is to develop on top of them, but how big the entire stack of technologies
that one relies upon in order to serve a web application.
<br>
By web application, I mean something relatively limited in scope, ie, something
based entirely or almost entirely upon static HTML and HTTP POST requests, e.g.
a web forum as the prototypical example.
<br>
The current "stack" I have landed on is Go + SQLite. However, I have some reservations about this:
<br>
1. Go is a programming language that is controlled by Google and has only two
implementations. It is also much more complex than a programming language ought
to be, and would be challenging to make an alternative implementation. <br>
2. SQL is familiar but enormously and unnecessarily complex, burdened by decades of arbitrary historical change.
SQLite itself, while an admirable project, is 100,000 lines of C maintained by a single organization.
<br>
Here are some alternatives I have looked into:
<h2>Programming languages</h2>
<b>Ruby</b>: Interesting in that implementation of the language is simpler than Python. <a href="https://mruby.org/">mruby</a> project is an alternative implementation in ~10k LOC!<br>
<b>Lua</b>: Similar advantages to Ruby. Language is praised for its simplicity, but I'm not familiar with the details of what makes it preferable to Ruby, so I'm going on trust here.<br>
<b>C</b>: Everything else is C at the end of the day, but it seems highly risky to try and build a "web app" in pure C. I certainly don't trust my abilities.<br>
<b>Scheme</b>: Extremely simple language to implement. Chicken Scheme design + libraries seem highly aligned with the values of this doc. Disadvantages is that Scheme/Lisp is less familiar to many devs. Much less existing web code, so you'll be DIYing things (not necessarily a bad thing)<br>

The most promising option to me currently is Scheme (using CGI), but I've only experimented a bit with their web libraries. Are there other simple languages that are appropriate for web programming?

<h2>Databases</h2>
I know little about non-SQL databases. The only alternatives I've pursued are a
Flat-File database, ie, just a text file. This seems overly-simple to the point
of simply causing problems and being annoying to build anything not entirely
trivial on top of. I have looked a bit into Prolog/Datalog, but I'm not aware
of any simple, embedded implementations, does anyone know of any? Maybe a small subset of SQL
implemented in a similar way to SQLite would be interesting, but I'm not aware
of any projects like this.

<h2>Conclusion</h2>
An alternative perspective here is that I am going too far here -- ie, that if
you're building for the web, you've already "self-alienated" by relying on an
enormous amount of centralized infrastructure, and you should just use existing non-ideal
libraries to make your life easier (maybe Ruby on Rails or something similar,
or just stick with my existing stack). However, I'm not convinced that what I'm
pursuing here is entirely worthless. Even on a practical level, what kind of
web stack could be simple enough that it could run in 20, 40 years? Or even
just, what does a web application specifically designed to minimize operational
burden look like (for hobbyists)? Some people may be interested in this.  There
are applications that have achieved that, but it is primarily by accident and
necessity, and I'm interested in what it would look like by design.