[racket] Goldilocks: install too big, install-plain too slow

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Dec 3 12:17:45 EST 2012

At Wed, 28 Nov 2012 14:23:07 -0800, Daniel Farina wrote:
> I'm working on a racket buildpack for use on Heroku (again -- I tried
> and aborted it about a year ago) but have noticed that the size of
> Racket and startup time in racket applications suffers quite a bit
> because 'make install' installs all kind of stuff: mzscheme
> compatibility libs, gui libs (on a system with no gui stuff), textbook
> curricula languages, et al.
>
> [...]
>
> I have tried the install-plain make target and it is indeed much
> smaller, but it compiles/installs very little -- no raco, and
> apparently very little byte-compiling, because the racket REPL takes
> an age to load -- so it's basically unworkable.
> 
> Is there a reasonable in-between option?

Not yet. We are working on a new package system, and we expect that
things currently in the distribution will gradually migrate out as
packages. More generally, we expect that it will be easier to have an
in-between point as we more carefully sort out dependencies.

> In particular, I'm thinking about crawling through the submitted
> racket source and finding all (require) forms as to evaluate them
> up-front at submission time: because running programs do not have a
> persistant file system, not doing this would result in every freshly
> started program downloading from PLaneT over and over, and, if PLaneT
> were to go down, no non-trivial racket program could start up
> successfully.

The `raco exe' tool does this sort of thing, and its
`write-module-bundle' function may be what you want.

The `raco demod' tool is even more aggressive --- it flattens a module
graph into one module --- but it doesn't seem to have a documented API.


Posted on the users mailing list.