News for hackers. Stuff that matters.
Re:CP/M Creator Gary Kildall's Memoirs Released as Free Down... by wvenable on Friday July 18, 2025 @04:03PM (#44609173)
Tokenizing is a necessary but not a sufficient task for compilation. I could tokenize this comment to efficiently store it in a database but that would have nothing to do with compilation.
Re:CP/M Creator Gary Kildall's Memoirs Released as Free Down... by WalterBright on Friday July 18, 2025 @08:36PM (#44611430)
Recognizing `3+x*(2+y)` is compilation - even if the program is being executed while compiling it.
Re:CP/M Creator Gary Kildall's Memoirs Released as Free Down... by wvenable on Friday July 18, 2025 @10:07PM (#44611928)
You can continue to argue the point but that goes against every single definition of compilation that exists. Compilation is a transformation of programming language into another form. For example, taking `3+x*(2+y)` and transforming it into a series of byte codes, machine language instructions, ASTs, or even C code would be compilation.

The BASIC interpreter doesn't recognize `3+x*(2+y)` nor does it compile it instead it evaluates that expression using a pair of stacks. You've expanded the definition of compilation to cover almost all computation. It's compilers all the way down to the electrons.

Re:CP/M Creator Gary Kildall's Memoirs Released as Free Down... by WalterBright on Saturday July 19, 2025 @12:29AM (#44612604)
Well, all my compilers use recursive descent for expressions, meaning the stack is used to maintain the current state. Whether you evaluate it while doing this or produce an IR is a trivial difference.
Re:CP/M Creator Gary Kildall's Memoirs Released as Free Down... by wvenable on Saturday July 19, 2025 @01:01AM (#44612725)
It might be a trivial difference but it's literally the thing that makes something a compiler. It should make sense. How a piece of software works doesn't make it a compiler or not; it's input and output of the software that defines it as a compiler. That's true of almost any broad category of software.
Re:CP/M Creator Gary Kildall's Memoirs Released as Free Down... by eichin on Saturday July 19, 2025 @03:11AM (#44613266)
No problem calling it parsing, but yeah, "compilation" feels like a huge stretch. And they didn't do recursive descent - just tokenizing for compactness (when you only have 4k or 16k of RAM you do things like that) - you could still get syntax errors at runtime. In some interpreters it also served to normalize abbreviations to save typing.