Skip to content

silky/abstract-machine-debuggers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debuggers for abstract machines

An exploration of writing a debugger for CEK-style machines.

The machines are all implemented as state machines (see StateMachine.hs).

The machines progress in order:

  • A basic CEK machine (CEK.hs)
  • A CEK machine with direction control (DCEK.hs)
  • A CEK machine with direction control and breakpoints (DCEBK.hs)

You can play around with a state machine by doing something like the following:

> cabal repl
> :m +REPL StateMachine BreakLambda DCEBK Text.Megaparsec Data.Maybe
> repl dcebk (inject (fromJust $ parseMaybe parseExp "(\\x.x)(\\y.y"))
# type "Step"/"Continue"/"Next" etc.

References

The approach here is very much inspired by [Advice about Debugger Construction] (https://pdfs.semanticscholar.org/7ae9/3a0f1ecac0094051345e518282a333a9df96.pdf), although I think I have managed to find a significantly simpler way of achieving the same thing.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 91.0%
  • Nix 9.0%