/tinyletter

The Programs of a Week of

This Week’s Program: July 31 - Aug 1

Hello there friends. Gonna be real with you. I did not do much coding this week. I kind of phoned it in. A couple of commits adding Scribble documentation, that’s pretty much it. I did a lot of thinking though. I looked at the Overscan codebase and I thought. I thought the shape of it and what needed to be carved. There is one commit that is pretty darn important.

6acbd6c3f91a1d9dfd3fb5c9deccb95d367a8c4d

Every .rkt file begins with a line that starts with:

#lang

Racket is a laboratory for programming language research, and the #lang line tells Racket what language should be used to interpret the file. When working with macros in Racket, you’re working with Racket’s expander layer. You’re taking syntax and manipulating it to produce a parse of the program. There is a layer before the expander layer called the reader. The reader is responsible for reading a character stream and transforming it into syntax. The #lang directive is used to determine how the source file is recognized at the reader level.

In this commit, I transform Overscan from just some ol’ Racket module into a new language. That sounds like a lot, but it’s actually pretty simple.

In a new file, instead of doing something like:

#lang racket
(require overscan)

I now can do:

#lang overscan

Practically, nothing else changes.

I’m adopting the same strategy used in the #lang slideshow library. When you declare a Racket file to be in the Slideshow language, slideshow re-exports (almost) all of racket and pict.

Here’s some of the other things I thought about:

  • Documenting Introspection has showed how silly some of the assumptions of that library are. I need to rethink a few things here.
  • Continuing to build out the GStreamer library. Maybe even have it be Object Oriented and bring in racket/class.
  • Do some special stuff in Overscan w/r/t the “videobox” element. This is what’s used in picture-in-picture. Would love to build out support to dynamically change the dimensions and positions of the box while broadcasting.

All of these thoughts. Gotta write the code!

🤔 Mark