Forlan is a toolset supporting sophisticated experimentation with
formal language theory. It is implemented in Standard ML (SML), as a
library on top of Standard ML of New Jersey. Forlan is used
interactively, but users are able to extend it by defining SML
functions. I implemented Forlan in SML because SML's concepts and
notation are similar to those of mathematics, and yet it is easy to
write efficient code in SML. My hope was that it would prove possible
to express the algorithms of formal language theory in ways that were
simultaneously natural and reasonably efficient, and my presentation
will assess how well SML supported achieving this goal. My
conclusions are largely positive, but limitations in SML, especially
the lack of subtyping and dependent types, sometimes made it difficult
or impossible to perfectly capture the mathematics. Furthermore, the
documentation of Forlan was hindered by the lack of support in SML for
expressing specifications. I will argue that a modern language should
allow specifications to be formally expressed, so that implementations
may, at a minimum, type-check them, and, ideally, will employ a
theorem prover or proof assistant to assess their validity.