[Haskell-cafe] Picking an architecture for a Haskell web app
Andrew Coppin
andrewcoppin at btinternet.com
Thu May 10 12:14:31 EDT 2007
>> I've crawled all over the webpage, and I can't see any documentation
>> anywhere to this effect, but presumably all this dynamic goodness
>> only works if GHC is installed, right?
>
> Yes, it's GHC-specific.
I can see it's GHC-specific, what I was asking is does the computer than
runs the final program need to have GHC installed. Presumably is does if
it's going to compile files on the fly. What about if it only loads *.o
files that are already compiled? Is GHC still required? (Not that the
answer worries me greatly; I'm just curiose.)
>> BTW... Does lambdabot seriously take every expression you type and
>> compile it to a binary executable, dynamically link it, and execute
>> it? I was expecting it to just run a simple source-level interpreter...
>
> There ain't no such thing, and if it were it'd be painful at best.
> Future versions of lambdabot *might* use ghc-api instead, but yes, it
> really does compile and link a program. I think that allows it to
> exercise tighter control over what is permitted to execute, i.e. hide
> everything capable of I/O actions.
Wait a sec... Are you trying to tell me that it is *faster* to take the
source, type check it, convert it to Core, perform 25,000 Core-to-Core
transformations, convert Core to C, call GCC, link the result together,
dynamically load it, execute it, extract the result and confirm that it
type checks, and display it....... then it is to just directly execute
an interpreted expression? I find that highly surprising.
(I don't have the source any more, but a while back I wrote a short Tcl
script that takes some function definitions and an expression and
interactively step-evaluates it. Sure, it didn't support every syntactic
construct that Haskell has, but it supported enough that a vast number
of Haskell functions could be implemented. And evaluation was
instantaneous. Even though the parser was written in Tcl.)
More information about the Haskell-Cafe
mailing list