News for hackers. Stuff that matters.
Re:Pragtical: Practical and pragmatic code editor by kerkeslager on Tuesday August 20, 2024 @12:48PM (#41301650)
Single pass compilation can support backreferences, i.e. referencing a symbol and then defining it later, efficiently with a technique called "backpatching". All single-pass compilers I know of use backpatching for computing jumps--I'm not even aware of any other way to compute jumps. For symbols, the implementation of backpatching is a bit more complex, but it's a pretty well-known solution and I don't think it would be a significant barrier for any competent compiler developer. That is to say, if they've chosen to not support backreferences, it's not because it's hard to do in a single-pass compiler.

EDIT: The wonderful book Crafting Interpreters has an implementation of backpatching jumps to implement loops. Before anyone says "this is an interpreter, not a compiler", be aware that most modern interpreters contain a compiler. https://craftinginterpreters.com/jumping-back-and-forth.html

Re:Pragtical: Practical and pragmatic code editor by Iwan-Zotow on Friday August 23, 2024 @10:38AM (#41329410)
Sure, we could do some craft to work around single pass limitations, but that was Don Syme decision from long time ago, and F# folks are faithful to it.

Actually liked language a lot, thought it could replace Python as top level AI/ML tool