by RodgerTheGreat · 2y ago · 0 comments
The project that currently occupies most of my time, Decker[0], is a rapid development platform that can produce standalone single-file HTML "applications". The detail I'm most proud of is that every such app still contains the entire suite of editing tools: anything made with Decker is ready to be customized and extended by end-users.
It took a while for me to understand that I could do anything with that (or might want to do anything with that), but eventually I realized that there were descriptive names for sections (function names!), and that there were patterns in the list of opaque words like "CMP" was usually followed by a "BEQ" or "BNE", and hovering over one of the latter two would pop up an arrow to another line, just like if I hovered over a "BRANCH" -- aha, "CMP" must be "compare" and then "BEQ" is branch-if-equal, and "BNE" is branch-if-not-equal!
That was approximately the first time I realized that computer programs weren't magic, that they were complicated things built out of simpler things, and that it was possible in principle to see and understand the simpler things.
Then I realized I could change how it worked, just like changing the menu bar or graphics, by changing the corresponding hex codes next to the words! First time was to find a section like "checkIfRegistrationCodeIsValid" and notice a "CMP" followed by a "BEQ", and change that to a "BRANCH"...
But how in the hell do you read that source code. I've seen some gnarly C in my time but man what even is that. How are you able to maintain this? It's beyond me. Please explain!
I use a handful of macros to abstract out repetitive patterns (EACH is a for-loop that iterates over all the elements of a lil list/dict), very short names for the most frequently-used utility functions (lin: lil-is-number? lil: lil-is-list? lmn: lil-make-number, lml: lil-make-list, etc), and typically aim for one idea/process per line, rather than one statement.
I find most C code dreadfully verbose, repetitive, and sparse. This style makes much better use of screen real estate and allows me to look at even fairly complex routines all at once, without having to scroll or jump around. Many APL-family languages use similar conventions in their implementations, though often relying much more heavily upon macros and abbreviations than I do.
The rest was an offline experience. You tinkered with the precious downloaded files. You knew how to change bytes with a hex editor, even if you knew nothing about the format.
Years later, programming in Win32, I found you could do a lot of tinkering by getting window handles to windows and UI elements of other programs and changing attributes / calling various functions. I don't think this was exploited nearly enough by the curious youth.
These days if you show a kid that if you type
javascript:document.body.contentEditable=true
in the address bar you can change the contents of a web page just by clicking and typing they'll have a great time creating fake news items, etc.
So damn handy. And set me off on the path of programming for sure.
And is this available as a desktop too? or is it web only?
There is a native version of Decker implemented in C using SDL2. It's fairly easy to build from source for Linux[0], and I offer periodic Windows and MacOS builds on itch.io[1].