During our tutorials, we’ve seen how a language implemented in Racket is essentially a source-to-source compiler that converts the code of the source language into an equivalent Racket program.
One benefit of this approach is that any Racket-implemented language can cooperate with a core set of Racket tools, like DrRacket. For instance, we built a syntax colorer for basic that works with DrRacket.
But the benefits aren’t merely cosmetic. Because a Racket-implemented language ultimately becomes a Racket program, these languages can do anything that an ordinary Racket program can.
For example, #lang brag. On the surface, it doesn’t look like Racket or behave like Racket. But it can export functions like parse to other Racket programs, which remain unaware that those functions were generated by a domain-specific language.
In this third and final basic tutorial, we’ll learn that even though BASIC is a language from the ’60s, there’s no reason we can’t graft on some new pieces to make it cooperate with the broader Racket ecosystem.