Live-coding a Lunar Lander for the AGC - also, Cowgol for CP/M

,

Here are a couple of long live-coding videos. David Given, aka hjalfi, has quite a calm and informative delivery, so settle back, listen, and learn! (The video descriptions contain a great number of labelled timestamps so you can jump to the best bits.)

First, a Lunar Lander running on the AGC:

What better way to commemorate the moon landings and also indulge my fondness for compilers and strange processor architectures than to do a port to the Apollo Guidance Computer, possibly the weirdest and most expensive computer of all time? And what better game to run on a LEM than a lunar landing game?

Blogged here:
Writing a lunar lander game for an actual lunar lander

Cowgol is a new Algol-like language hoped to be suitable for self-hosting on retro computers. Here’s a thread on 6502.org:
I’ve just released Cowgol, a fully compiled, almost self-hosted strongly typed Ada-inspired modern programming language for the 6502.

And here’s his recent live-coding of an 8080-targetting version of cowgol:

It’s an utterly simple one-pass compiler, using flex and yacc for the lexer and parser, and a stack-based intermediate language with a few basic heuristics to generate runnable 8080 code. Everything has been sacrificed for the sake of simplicity. Did it work? Watch the video and find out.

David previously appeared here in the thread Anyone like an open source CP/M?.

1 Like

For a language called “COWGOL,” shouldn’t that be “udderly?”
Sorry. I just couldn’t resist.

1 Like

Why is there no “pain” reaction.

There is only :heart:. (:heart: is all you need.)

(Oh, but I see there are emoji available in the compose window… :grimacing: :face_vomiting: :exploding_head: :scream: :face_with_head_bandage: … I never was very good with these.)

BTW there are a couple of things to look for in a lunar lander game:

  • a late burn at a low altitude might in reality crash, so code should check for a negative altitude part way through the burn. Ending the burn with a positive altitude and upward velocity is not enough to know that you survived.
  • much of the lander’s initial mass is fuel. So as you proceed to burn, your craft becomes lighter, and the acceleration from a given burn becomes greater. The effect is greatest as you approach empty.
1 Like