|Date:||Tue, 15 Nov 2022 16:11:26 -0800 (PST)|
|References:||22-09-026 22-10-025 <29190_1668508275_63736A72_29190_327_1_22firstname.lastname@example.org> 22-11-009 22-11-013|
|Injection-Info:||gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="65457"; mail-complaints-to="email@example.com"|
|Keywords:||design, syntax, comment|
|Posted-Date:||16 Nov 2022 05:57:15 EST|
On Tuesday, November 15, 2022 at 1:15:04 PM UTC-8, minf...@arcor.de wrote:
(snip on Forth, and its simple implementation)
> > [It has small efficient implementations, it generally lets you get close
to the hardware,
> > and the RPN syntax lets you define new operators that work like the
built-in ones. -John]
> Forth comprises a _very_ simple interpreter and compiler. Both can be
> modified and enhanced easily to the problem domain. IOW Forth is
> extensible to the core of the language while still being small and
> simple enough to fit into one single person's head.
> Citing its inventor Chuck Moore:
> "By permitting the program to dynamically modify its control language,
> we mark a qualitative change in capability. In a sense, our program
> has evolved into a meta-language which we apply to the application.”
PostScript is also based on an RPN language interpreter, though I
am not sure that the above quotes apply in the same way.
One that I know about PostScript, and maybe not be true for Forth,
is the bind operator.
Before def, which defines a new operator, you can bind, which binds any
operators inside the new definition to their current value. (I believe it
also optimizes them to the address of the routine, saving the time for searching
for the name in a symbol table.)
Some years ago, working on converting TeX output for a book to
PostScript, we had to write macros which redefine def.
The DVI conversion was designed for 300dpi laser printers, and
didn't have a convenient way to change to a higher resolution.
So we wrote a header with new macros, and which then redefined
def such that later macros wouldn't override them.
(I think we always called them macros, not operators, but I am not
sure by now what the right name is.)
The Sun boot roms also use Forth, or something Forth-like as the
built-in control language.
[The FreeBSD boot also uses Forth for boot-time configuration. It's a nice
little language but we're drifting away from compilers. -John]
Return to the
Search the comp.compilers archives again.