#programminglanguages

2 posts · Last used 10d

Replying to
My process of reverse engineering this was quite methodical. Since it is hand-written assembly, it employs numerous clever tricks, global program knowledge, and ad hoc calling conventions for every function. Many functions have straightforward dataflow and a clear calling convention. Some require examining the demanded registers across all callers, to determine whether a register is written or clobbered. But a nightmarish trio of functions are mutually recursive. To correctly analyze these, I annotated points with the register and stack state. Loops merge states on backedges, branches merge states on join. So far so good; this logic remains relatively local. At recursive calls, I'd initially assume the call would update all state and I'd represent this with fresh values for all registers. This lets me do a dataflow analysis as usual. But some of these fresh values were observed, so I couldn't stop yet, as a full fixpoint was required. I repeatedly propagated constraints between the functions until the calling conventions were fully resolved. Yes, I did this by hand. Yes, I'm crazy. I'm working on a decompiler for PDP-11 assembly to period-appropriate C, but I haven't finished it yet, so I instead played as the static analyzer. 5/6 #programminglanguages #reverseengineering
33
14
3
0
This is the most exciting technical thing I've seen this week. Stephen Diehl has built an algebraic effects language, #prism , that might actually be usable. I've been excited about algebraic effects since Bauer and Pretnar's 2012 paper. Haskell's stacks of monad transformers always looked to me like a first-generation hack: yes, we have the technology that could fix the Awkward Squad, but we don't know yet what to do with it. Algebraic effects seemed like they could be the way forward. But I tried programming in Eff and found it impossible to make _anything_ work. Even if Prism isn't practical for practical programming, it's a big step forward, and worth a look just for the ideas. #haskell #algebraicEffects #programmingLanguages
67
12
45
2