<div dir="ltr">I&#39;m building a website using Scribble as the source format. As a development tool, I&#39;ve built a web server in Python that lets me view all my Scribble source files and look at them in different states of processing. To view the results of the Scribble files, the Python server just sends the files to Racket via a system command (os.Popen) and reads the result. This works but it&#39;s slow, because it  has to launch a new Racket thread for every request.<div>
<br></div><div>I thought I could speed things up by rewriting the development web server in Racket. But having tried a few approaches, I&#39;m not sure how to duplicate this functionality within a Racket web servlet: </div>
<div><br></div><div><b>(require &lt;modulename&gt;) </b></div><div>This only gets evaluated once, when the server is started. That doesn&#39;t help, since the &lt;filename&gt; is going to be passed in as a parameter while the server is running.</div>
<div><br></div><div><div style><b>(dynamic-require &lt;</b><b> modulename </b><b>&gt;) </b></div></div><div style>This gets evaluated only when invoked, and thus can take &lt;modulename&gt; as a parameter, but then &lt;filename&gt; can&#39;t be reloaded (this is essential, as the point of the system is to be able to edit the files and see the changes in the web browser immediately)</div>
<div style><br></div><div style><b>(enter! &lt;modulename&gt;)</b></div><div style>This reloads the file, but it&#39;s not clear how to get access to names provided by &lt;modulename&gt;. (The documentation for enter! suggests that this is not how it&#39;s meant to be used anyhow.)</div>
<div style><br></div><div style>Obviously, I could call a new instance of Racket as a system command, but that wouldn&#39;t offer any advantage over the current approach.</div><div style><br></div><div style><br></div><div style>
I suppose what I&#39;m looking for is an equivalent of the Python reload(&lt;modulename&gt;) command.<br></div><div style><br></div><div style><br></div><div style>Matthew Butterick<br></div></div>