Adding #lang support in Guile would be nice. As discussed on IRC, it
can be experimented with in a WIP branch.
Have you seen my messages on how the "#lang" construct is problematic
for some languages, and how alternatives like "[comment delimiter] -*-
stuff: scheme/ecmascript/... -*- [comment delimiter]" appear to be
equally simple (*) and not have any downsides (**).
(*) The port encoding detection supports "-*- coding: whatever -*-",
presumably that functionality could be reused.
(**) For compatibility with Racket, it's not like we couldn't
implement both "#lang" and "-*- stuff: language -*-".
I haven’t seen your messages yet, I just wanted to express support of
the general idea. For years, we have discussed #lang support; I know
Andy is enthusiastic about it, and while I was initially reluctant, I’ve
come to appreciate the idea.
What you point out is worth considering, but note that Guile already
supports #!r6rs for instance.