[Kevin Queen]
> when the parser reads and executes the file it reads it
> line by line on the fly, unlike a traditional "pre-compiled"
> language where the include must be done @ compile time
> to verify syntax and variable declarations (This is why
> if you screw up a CFIF halfway down the page the first
> half is displayed and then the error message pops up under
> the already displayed half a page.

Not anymore.  :)  CF is now sorta-precompiled.  (I dunno what Allaire calls
it.  Anyone?)  As of 4.5 (did they have it in 4.0?) the script is run
through a parser once and precompiled once.  None of that silly line-by-line
stuff anymore.  It's a bastard mutation of interpreted and compiled; a sort
of second-cousin to bytecode compilation, if I understand it correctly.  To
use your own example against you, try this in CF4.5:

<!--- begin test.cfm --->
<CFOUTPUT>foo!</CFOUTPUT>
</CFIF>
<!--- end test.cfm --->

You should never see the "foo!" part, as the server will catch the unmatched
CFIF on the first pass.

Now, the interesting part of this: add the following Application.cfm to that
test directory:

<!--- begin Application.cfm --->
<CFOUTPUT>bar!</CFOUTPUT>
<!--- end Application.cfm --->

You'll note that you now see the "bar!", but get an error before you see the
"foo!".  In other words, the CF server is compiling *and executing* the
Application.cfm before it ever even bothers to load the test.cfm.  This is
kinda logical, if you think about it: much of the time you'll be using the
Application.cfm to CFLOCATION or CFABORT out of the way before you ever even
get to the page, so why bother loading it up if you may not need it?

Getting back to the interpreted-vs-compiled question, I asked Jeremy and a
few of the other programmers at the Con in Boston last year if they were
ever going to go to a bytecode format.  (It would provide the answer to more
problems than you'd think.)  The answer I got at the time was "not now,
probably not ever".  Does anyone know if they've reconsidered this yet?

-Rick

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to