"I Apologize for the Delay"

Anytime I feel bad about my slowness of production, the inconveniences in my life blocking me from getting work done, I remember the MegaTokyo Visual Novel, which I paid $50 for in 2013, and of course Fred never shipped, he never finishes anything. I knew I was throwing my money away then, and the $299,184 he raised may as well have been set on fire for all that'll come of it.

Today, MT rant has a bit of a status update, first one in a year.

So in comparison, I'm a fucking machine cranking out the awesome. Where's my third of a million bucks?!

What I'm Watching: Adam Ruins Everything

So, up front: Adam Conover has a ridiculous shaved-side mullet and horrible suits that would look stupid on a christian boy band, let alone on someone trying to educate you. Whatever the modern fashion industry is, he ran thru the sewage runoff from it.

E1 does a good job of debunking TSA, safety caps on drugs, and Tylenol, and has good expert guests, especially Bruce Schneier on an iPad telepresence rig. The skits are amusing and get to the point.

E2 starts OK, with the car dealership scam, but rapidly collapses. He doesn't manage to mention that in many states Tesla has evaded the scam, and the FTC has started discouraging it. And then the anti-car diatribes start, clearly the work of someone who's never left a city or seen grass, trees, or the stars on a clear night in his life. While we could rebuild our cities for public transit and pack everyone into claustrophobic hive cities with total light and noise pollution, and total surveillance, the US is a huge country where many people prefer to commute from distant suburbs or little towns so they can live in peace and quiet away from you noisy, snooping motherfuckers. And the stoner kid and his friends in the skits are super annoying. FAIL.

E3 attacks police "forensics", and at least sticks to just a few characters for the skits, and kind of a plot. It's a little too uncritical of DNA analysis, which has been used for some of the same systematic frauds, and he keeps claiming the pigs have "unconscious" bias. The pigs know exactly what they're doing and why they're caging people on false pretenses.

Hmn. I like the premise, but Adam is moderately terrible at delivering it.

★★★☆☆

What I'm Watching: Errementari: The Blacksmith & the Devil

What a charming film. Basque, with maybe the worst dubbing I've ever heard, so put it on English subtitles and Basque language. Lovely real-looking run-down sets, especially the forge, dark cinematography but not cyan/orange.

Set in early 19th C after the Basque lost their independence. Follows a blacksmith with a temper, a bizarrely fortified forge, and a deal with the Devil. The scarred, orphaned girl, Usue, is adorable, mean, and hilarious. The government fop isn't just there to rob the smith. The priest is a mean, conservative old bastard, the innkeeper and his grasping cronies deserve the bad ends they're all coming to, the town children other than Usue are brats. The demon Sartael is excellent, both makeup and mythical behaviors.

Cast, writing, and design are all perfect. The ending is very old-school D&D problem-solving.

Reminds me a lot of The Witch, or City of Lost Children, in this half-real, half-dreaming style and the grotesque people.

★★★★★

Chicken Soup

(a bunch of stuff in a pot)

REPL

The Chicken csi REPL is appalling after using some nice REPLs, it doesn't even have history by default. I couldn't reliably get non-GNU readline-likes to work, so:

% chicken-install -sudo readline
% cat >~/.csirc
(use readline)
(current-input-port (make-readline-port))
(install-history-file #f "/.csi_history")
^D

So at least now it has the usual up/down/emacs-like keys.

Long fucking ways from the old Symbolics LISP Machines. Why don't we have environments like that anymore? Why is everyone content to just use fucking emacs (I've never been emacsulated) or other editor, and a boring REPL? DrRacket is just a REPL that destroys its memory every time you edit code, and it's the most graphically advanced LISP-type environment. And this is why I still just use Atom with Symbols Tree View (even though it thinks variable definitions are functions), and copy-paste into iTerm if I want to test something.

Value Unpacking

Not having nice R6RS macros for this, and unwilling to fight with classic macros, I've been using values to unpack lists into variables, and because I can never remember the exact syntax, I made this cheat-sheet:

(define a '(1 2 3))
(define b '(4 5 6))
;; then one of these:
(define-values (x y z) (apply values a)) (printf "~s,~s,~s\n" x y z)
(set!-values (x y z) (apply values b)) (printf "~s,~s,~s\n" x y z)
(let-values [[(x y z) (apply values a)] [(q r s) (apply values b)]] (printf "qrs:~s,~s,~s xyz:~s,~s,~s\n" q r s x y z))

Probably not efficient, but better than car, cadr, caddr, etc. Maybe I should move all my list-structures into vectors, but then I'd still have to convert them to lists half the time. Here's where Python is the programmer's best friend, even if it is 10,000x slower:

a = (1, 2, 3)
x, y, z = a
print(f"{x},{y},{z}")

Why Did LISP Fail?

How did a more advanced language with better tools just die off commercially, and now if you want to work in it, you have to cobble together a bunch of half-broken shit?

I think there's 3 reasons:

  1. It's hard and ugly. It may be logically compelling, but when you see a page of parens your brain panics and looks for a place to hide.
  2. Companies value the fake productivity of thousands of lines of C, Java, or Swift (aka C++2020) code more than having safety, security, and correct reasoning. Who cares if millions of people will suffer and possibly die from your code, as long as you can ship TODAY?
  3. A lot of LISP "hackers" are insufferable douchebags, both old beardy fuckers who've been doing it for 50 years and mewling children who learned it last week. Every new variant makes the older contingent more angry at even seeing a mention of it, and the sneering fetuses think whatever variant they learned is Divine Wisdom, rather than just an engineering tool that may need to be improved.

Building a Binary with Chicken Scheme

So that was fucking fun. Seems Chicken's docs aren't correct on how to build with modules, because those were added after the dark-ages R5RS it was modelled on.

There is an "egg" system which is used for building the libraries, but it's difficult to use for making binaries in your own destination dir, and fills your work dir with spam temp files. Unfortunately basically useless for work.

Finally got this working:

src/somelib.scm:

(declare (unit somelib))
(module somelib
    (hello)

(import scheme)

(define (hello) (display "Hello!\n"))
)

src/somemain.scm:

(import scheme
    (chicken load)
)

(cond-expand
    (compiling (declare (uses somelib)))
    (else (load-relative "somelib.scm")))
(import somelib)

(hello)

Don't you just love that muffin-man-muffin-man repetitious bullshit? declare is for the compiler, load is for the interpreter, then import for both. You import builtins like chicken, but use libraries (aforementioned sdl) without an import. Bizarre and contradictory.

build.zsh: [script updated 2019-06-08]

#!/bin/zsh

# EXE is binary filename
# MAIN is main script
# LIBS is space-delimited, must not include main script

function usage {
    echo "Usage: build.zsh PROJECT || MAIN.scm [LIBS] || ls || -?"
    exit 1
}

if [[ $# -eq 0 || "$1" == "-?" || "$1" == "--help" ]]; then
    usage
fi

case $1 in
    ls)
        echo "Known projects:"
        # Add known projects here
        echo "eldritch test"
        exit 0
    ;;
    eldritch)
        EXE=eldritch
        MAIN=eldritch.scm
        LIBS="marklib.scm marklib-geometry.scm marklib-ansi.scm"
    ;;
    test)
        EXE=marklib-test
        MAIN=marklib-test.scm
        LIBS="marklib.scm marklib-geometry.scm"
    ;;
    *)
        # command-line project: MAIN=$1, LIBS=$2...
        EXE=`basename $1 .scm`
        MAIN=$1
        shift
        LIBS="$*"
    ;;
esac

mkdir -p bin

cd src
for SF in ${=LIBS}; do
    SNAME=`basename $SF .scm`
    echo "Compiling $SF"
    csc -c -j $SNAME $SF -o $SNAME.o || exit 1
done
echo "Compiling $MAIN"
csc -c $MAIN -o `basename $MAIN .scm`.o || exit 1
echo "Linking..."
csc *.o -o ../bin/$EXE || exit 1
rm -f *.o
rm -f *.import.scm
cd ..

echo "Built bin/$EXE"
% ./build.zsh
Built bin/something
% ./bin/something
Hello!

Hello, working native binary! There's a bunch more stuff about making a deployable app, but I'll take this for now. My actual program can show a blank green graphics window!

More Fun and Swearing with Scheme

I have ideas for some little games, which aren't suitable as giant Electron-powered applications. My preference in language for this would be Objective-C, Scheme, Pascal, C if I absolutely had to. Obj-C's lack of portability rules it out for now, but if GNUstep gets their crap together it may go back in the running. Scheme looked promising, I've liked using Chez Scheme for some data processing.

So after 2 days of experimentation and abuse, and none of my tools working right in the process, I was unable to get thunderchez/sdl2 to link. I can explicitly load the dylib, and it doesn't find SDL_Init. I wrote a little C program to prove that SDL is reachable, and it is. Chez just won't load it.

Frustrated, I grabbed Chicken Scheme again, did a chicken-install -sudo sdl2, ran the sample code(!), and bam, it just worked. 15 minutes of effort at most, and I'm up and running.

Down side, Chicken compiles slow, and the interpreter is PAINFULLY slow; Chez "interprets" by compiling fast with low optimizations. And Chicken defaults to R5RS which is… 1990 called and wants me to watch MIT SICP lectures on VHS. It has some R7RS support, but I prefer the guarantees of portability, safety, and specified behavior in R6RS. Have to go looking thru SRFI docs to find any feature, it's not batteries-included. Oh well, I'll probably live just fine without ideological purity.

Programming is a Joy

"Programming is a joy. That's why people do it. No one should spend hours in front of a computer terminal out of some dreary sense of duty, or because they have some vague notion of becoming "computer literate". That's not the point. Programming ought to be fun—and if you're not having fun, you shouldn't waste your time."
—Michael Eisenberg, "Programming in Scheme" (1988)

What I'm Watching: The Haunting of Hill House (Netflix)

This is weird. A series based very loosely on Shirley Jackson's great book (more likely for the writers, the 1963 movie The Haunting or the shitty '90s remake).

The builders/founders of the house, the Crains, and the scientist ghost-hunters of the book, are here replaced by house-flippers with five children in flashback to the '80s(?). In middle flashbacks of the '00s, one boy becomes a ghost-hunter, one a junkie, one girl a mortician, one girl is useless, one a mousy little housewife. In present day, the plot moves forward. Sometimes the time is obvious from the characters in a scene, sometimes it's hard to tell which flashback is which, and the characters' clothing and accessories are not distinctive (fashion died in the '90s and never recovered). It's good that they have iPhones and iPads in the present, because those make it possible to date the scene.

Everyone seems pretty resigned to seeing ghosts or at least having hallucinations on a regular basis. OH NO the walls are banging in an old house, must be ghosts. OH NO my dead SPOILER is here where they were expected and now ghosts.

Long tracts of "dramatic" footage which aren't good enough for "reality" TV are painfully uncut here, I'm 2 eps in and it feels like it's been 12. The movie was so much better at getting to the point (that secrets and madness will make you see anything, even/especially if there's something to be seen). But there's scenes which are effective, where the oppression of Hill House works, where it actually creeped me out. The actors range from reasonably good (Stephen, Shirley), to stiff and unlikable ("Dad", and whoever the middle daughter is, I keep forgetting that she's even in this and then I go "wait, who's the other brunette?"), to bland caricature (the Dudleys).

★★★☆☆