On compiling. (Was a way off topic subject)

Paul Koning paulkoning at comcast.net
Wed Jun 23 16:18:19 CDT 2021



> On Jun 23, 2021, at 5:02 PM, Chuck Guzis <cclist at sydex.com> wrote:
> 
> On 6/23/21 1:14 PM, Paul Koning wrote:
> 
>> I don't remember the details at this point, but I assume the "execute TECO macro" operation in the Stevens PDP-10 TECO compiler is done in that way.  And of course these could keep the compiled code around to reuse if the source string hasn't changed.  A modern example of this technique is the regex library in Python, which lets you compile a regex string into a compiled regex object for later use, or lets you perform operations using the regex string directly.  The latter form caches a string -> compiled regex cache so doing this in a loop still performs reasonably well.
> 
> Could be the case of "what does "compile" mean?"  If the meaning is
> "reduce to machine language" maybe not.   Otherwise, if the meaning is
> "interpret", then maybe so.
> 
> Consider this paragraph of the tutorial at
> http://www.snobol4.org/docs/burks/tutorial/ch7.htm"
> --------------------------------------------------------
> 7.7 RUN-TIME COMPILATION
> 
> The two functions described below are among the most esoteric features,
> not just of SNOBOL4, but of all programming languages in existence.
> While your program is executing, the entire SNOBOL4 compiler is just a
> function call away.
> -----------------------------------------------------------
> 
> So maybe not rendering into machine code, but something else.
> 
> --Chuck

I meant "reduce to machine language" (give or take threaded code or library function calls).  It really doesn't seem to be any particular problem.  There's nothing about compilers that prevents them from being invoked in the middle of an application.  (Come to think of it, isn't that what a "just in time compiler" means?)

	paul



More information about the cctalk mailing list