[racket] typed racket slow?

From: Ray Racine (ray.racine at gmail.com)
Date: Wed May 8 13:27:27 EDT 2013

Nothing wrong at all.

binfmt is both a more complex and a more powerful approach.  It could be
set up files where one cannot place a hashbang such as zo files or and
often is for jar files.  While I haven't tried this, imagine you have
several cloud servers and wish to "promote"  Racket applications and Racket
utilities to each.  Certainly one could transfer up all the rkt source
files OR (modulo our issues) the zo files.  Assuming the existence of zo
magic values (probably there), then one could drop the zo extension and the
racket binaries run as any other command without the original source files.

Arbitrary example.  I did not not mean using binfmt did anything one could
not do already in the Racket tool sphere, such specifying the interpreter
in the source file or creating Racket exe or ...

I just tend to use binfmt for a number of different non-Racket uses so I
use it for Racket as well.

Sorry for the off-topic-ness.





On Wed, May 8, 2013 at 12:47 PM, Manfred Lotz <manfred.lotz at arcor.de> wrote:

> On Wed, 8 May 2013 10:27:09 -0400
> Ray Racine <ray.racine at gmail.com> wrote:
>
> > On a tangent, if you run your Racket on Linux (like anyone would use
> > anything else :0 ) you can "install" *.rkt files as executables with
> > binfmt.
> >
> > Very Short (no validation) Path
> >
> > 1) Create a shell script runracket.rkt in your racket installation
> > bin. i.e. /usr/local/racket/bin/runracket
> > #! /bin/sh
> >
> > racket -tm $1
> >
> > 2) Use your package manager to install binfmt.
> >
> > 3) Register .rkt files as executables handled by runracket.  As root:
> >
> > a) cd /proc/sys/fs/binfmt_misc/
> > b) echo ':RunRacket:E::rkt::/usr/local/racket/bin/runracket:' >
> > register
> >
> > 4) Have a sherbet.
> >
> > Then assuming you have a simple helloworld.rkt file with a "main" your
> > Racket file is now just another shell or executable.
> >
> > ray at rpr:~$ ./helloworld.rkt
> > Hello there.
> >
> > Obviously the above should be made more robust, adjusted be installed
> > on bootup etc, but that is the basic idea.
> >
> > Decent odds a Mac can do this as well.  Better odds Eli has something
> > done along these lines polished to perfection. : )
> >
> > To remove the entry echo -1 to the entry.
> >
> > $ echo -1 RunRacket
> >
> >
> >
>
> Thank you. Didn't know about binfmt.
>
>
> But why not just this:
>
> #! racket -t
> #lang racket
>
> (displayln "Hi world!")
>
>
> I saved it into rscript.sh, changed perms to 755 and it ran without
> problem.
>
>
> --
> Manfred
>
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130508/28f48ffe/attachment.html>

Posted on the users mailing list.