Jungle Coder
commentary a la unicorn
Just added post themes! Witness The Colors, and Exult!

Tabula Scripta: A spreadsheet for small data-driven apps

One of my hobbies of the last two years has been writing webapps. Last year, in December and part of January, I wrote an app called Gills, a journaling tool written in Go. One feature I added to it was the ability to define custom pages for Gills written in Lua. Since then, I’ve used that ability to shape Gills in a lot of different ways.

I’ve written pages that link to the cadre of webcomics I like, pages to keep a checklist of what I need to use on caters when I was working on Qdoba, pages that gave me overviews of blog post drafts, pages that keep track of notes on a backlog, and so on.

Point is, over half of the appeal to Gills for me was having a CMS that I could script from my phone or a chromebook. The main problem with Gills-as-CMS, rather than Gills-as-Journal or Task management-lite, is that, at it’s core, Gills has two fundamental types of data: Notes and Scripts. Adding any kind of other idea means adding in a parsing layer over that.

The inciting itch for Gills was the revelation that journaling could help my mind focus. I’ve since found a lot of other things that also help my mind focus. The inciting itch for Tabula Scripta is trying to keep track of Doctor’s appointments, believe it or not. Now, I have normal calendars, and other sorts of things in the in-between, so it’s not strictly necessary, but I’ve always wanted something that was like Excel, but wasn’t an utter pain to use from my phone. A place to collect gas mileage records, where I am in certain comics, or other light-weight data-driven websites. Sometimes, I’d rather not have to set up a database to make something data-driven.

This is where the idea of spreadsheets comes in. They make a natural habitat for scratching out data sets, cleaning them, or doing ad-hoc data recording. Formulas even make it easy to do analysis over your data. Add in the idea of scriptable forms, and you can make capture simple and easy, and you can also make reports and charting possible, maybe even a daily summary of different things on your plate.

The thing is, there isn’t currently, to my knowledge, an actual Access-lite webapp. Not that I’ve done a lot of research into the type of software. I had done a lot of research into task-tracking and journaling software before Gills, and still have gotten a lot of mileage out of making my own. I’ve always had a bent towards making software tools for myself, I don’t see a reason to stop now.

So, with all of that rambling out of the way, what is my plan for Tabula Scripta?

Zeroth, Tabula Scripta is going to be a WebApp, designed to be accessible from Mobile Devices as well as desktop platforms. That doesn’t mean that it’ll be 100% easy to use from mobile phones at first, but I’ll try to avoid being mobile-phone hostile.

First, I want to get a functional beta of a spreadsheet editor working. Right now, the idea is for the client-side to send updates from the user as they come in, and for the server to send back all the affected cells. This means that formulas will mostly be calculated server-side, which allows me to keep the JavaScript code focused on presentation, rather than on modeling the intricacies of evaluating the formulas.

Alongside this, I’m developing a hierarchy of folder, scripts, forms and sheets. I might add notes in there as well, The intent of all of this is to make it easy to build a project in Tabula Scripta without having to fuss too hard with the outside world. Webapps whose state can be contained inside a single SQLite database + executable are easy to operate once one learns a reverse proxy.

After I get the notes and folders going, I plan on building out a scripting language, which I’m planning on calling TabulaScript. I anticipate it seeing significant evolution over the next 6 months, as I dogfood Tabula Sheets in different applications. For now, I’m planning on writing a stack-based language, for the sake of implementation simplicity, but long-term I think I’d like to aim for something a bit more conventional.

Why add my own scripting language on top of all of this? In part because I think I have a lot I learned from PISC that I’d like to try to apply, but also because having a custom scripting language will allow me to do some unique spreadsheet-focused things, like building in support for tracking spreadsheet dependencies throughout the language, so that I can detect data-cycles, even if you’re using heavily custom scripts. It remains to be see how practical that ends up being, but it’s at least a thought.

I also plan on making it possible to extend Tabula Scripta with your own formulas, built on this scripting language, rather than relying on only the set that it ships with. Below are some sketches of how it will probably look at first. Long term, I may try to make the scripting language a bit more conventional.

formula: [sum range] [
     0 ->'total
     per-cell: 'range [ getNumberFromCell 'total add ->'total ]
     'total ->'result
]

Tabula Script is also going to be at the heart of forms, I think this is where it will shine:

# A proposed form for quickly recording appointments:


UI: [
    markdown: "# Appointments" # Gets converted to HTML
    style: [myForm.css] # drops in a style tag into the HTML
    raw: [<em>Tabula Scripta is just ideas</em>]
    form: [ # Designed to make it easy to build up input forms
         use-table-layout # an HTML table to layout the inputs for
                          # this form for pretty alignment.
         # If an input has two arguments,
         # the first is the label,
         # and the second is the variable name that the for will expose on submit
         DateTimePicker: ["Appointment Date" "ApptDate"]
         # If it only has one argument, that is both the label *and* the name exposed on submit
         Text: ["Location"]
         LongText: ["Notes"]
    ]
]


Submit: [
 # A stack-based pipline for now
 "Appointments.sheet" get-sheet "B2" get-next-empty-row ->'anchor-point
 # Save row takes an first cell, saves the first value in that cell,
 # and then keeps saving cells along the current row.
 # There will probably be save-col and save-grid for similar other applications.
 'anchor-point [ 'ApptDate 'Location 'Notes ] save-row
]

I’ve not thought through every little thing just yet, but I hope these examples give a decent first impression.

Ultimately, the first version of Tabula Scripta is aimed at making it faster for software developers to execute on small-to-medium ideas, rather than aiming it 100% accessible to everyone. Because there are a lot of small ideas that are worth being able to build, from making it easy to set up a College Club recruitment website, to making it easy to record workouts, to making it easy to keep track of web-comics. I don’t think these ideas each necessarily need a dedicated webapp for them, but combined together, I think something like Tabula Scripta could make it easier to build more of those small projects.

Long term, I’d like to look into adding things like cron-jobs, making it easy to skin/style Tabula Scripta, some form of user-access control (but that is not a priority for version 1), and a way to have a notion of publicly visible things vs internal things that only the admin(s).

But, once I get sheets, scriptable forms (which I intend to double as reports), and extensible formulas, I’ll see where the itches guide next.

Comments

Andres Moreno
Have you looked at Racket? Their shtick is making it easy to build programming languages. Scribble and Pollen are two Racket-based languages that are in some way related to what I think you want to do. I think of Pollen as JSX for markup and your little language is similar but instead of markup, you'd be thinking of cells and dependencies.
Next
Ultimately, the first version of Tabula Scripta is aimed at making it faster for software developers to execute on small-to-medium ideas, rather than aiming it 100% accessible to everyone. Because there are a lot of small ideas that are worth being able to build, from making it easy to set up a College Club recruitment website, to making it easy to record workouts, to making it easy to keep track of web-comics. I don’t think these ideas each necessarily need a dedicated webapp for them, but combined together, I think something like Tabula Scripta could make it easier to build more of those small projects.
Previously: Nim: Scripting ease in a compiled language
Next: Warming up to Unit Testing