3 ms·
Uh, a Pascal-like extension to FORTH, not a Pascal compiler in FORTH.
by guenthert 3y ago
Uh, a Pascal-like extension to FORTH, not a Pascal compiler in FORTH.
- sph 3y agoWhat is a compiler? This actually parses a subset of Pascal and translates it into another representation. Perhaps you can call it an interpreter. Compiler = parse + codegen — Later, the OS executes. Interpreter = parse + execute On metaprogrammable languages like Forth, what is the point of compiling to disk, if the final goal is to execute it anyway? ;)
- astrobe_ 3y ago> This actually parses a subset of Pascal and translates it into another representation. Perhaps you can call it an interpreter. I didn't read TFA thoroughly, but traditionally a compiler that translates not to machine code but into another language (source level) is called a "transpiler". > On metaprogrammable languages like Forth, what is the point of compiling to disk, if the final goal is to execute it anyway? ;) Lua and probably other languages do have a "pre-compiler", something that parses and compiles to bytecode. This reminds of image-based systems, except it is only one half of them (the other half being the value of variables, stack state, etc.). It must be much more rare for Forth dialects, as the parsing step is really simple - almost trivial. It has nothing to do with metaprogramming, though - actually, it adds a tiny bot of complexity (must check the "immediate" flag when compiling).