[racket] Racket in a browser?

From: Hendrik Boom (hendrik at topoi.pooq.com)
Date: Wed Apr 13 04:32:13 EDT 2011

On Wed, Apr 13, 2011 at 10:21:06AM +0200, Jens Axel Søgaard wrote:
> 2011/4/13 Hendrik Boom <hendrik at topoi.pooq.com>:
> > On Tue, Apr 12, 2011 at 08:17:02PM -0600, Jay McCarthy wrote:
> >> LLVM definitely supports tail-calls and GC.
> >>
> >> TCO:
> >> http://llvm.org/docs/CodeGenerator.html#tailcallopt
> >
> > Good to hear.  What does the restriction
> >
> > when generating GOT/PIC code only module-local calls (visibility =
> > hidden or protected) are supported.
> > mean?
> 
> A tail-call to a function located to another module will use stack space.
> But that's not too helpful -what is a module?
> 
> The docs are here:
>     http://docs.huihoo.com/llvm/LangRef.html#modulestructure
> 
> It says:
> >   LLVM programs are composed of "Module"s, each of which is a translation unit of the input programs.
> >   Each module consists of functions, global variables, and symbol table entries. Modules may be
> >  combined together with the LLVM linker, which merges function (and global variable) definitions,
> >  resolves forward declarations, and merges symbol table entries.
> 
> In the case of a C compiler it could mean one of:
>    *  a module corresponds to  a source file
>    *  a module corresponds to the source files that turn into one linker unit
> Which one is the correct one depends on how the C compiler uses the
> LLVM backend.
> 
> I do not know which is correct for llvm-gcc.

Isn't is possible to tailcall a fumction dynamically, i.e., one fetched 
form a variable or some such?  One for which you don't know statically 
what's being called,, let alone whether it's in the same module?  
Possibly even one thta has been JIT-compiled, considering that LLVM does 
have a JIT mode?

-- hendrik


Posted on the users mailing list.