Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akeep/abstract-racket
An abstract machine for analyzing Racket bytecode.
https://github.com/akeep/abstract-racket
Last synced: about 4 hours ago
JSON representation
An abstract machine for analyzing Racket bytecode.
- Host: GitHub
- URL: https://github.com/akeep/abstract-racket
- Owner: akeep
- Created: 2013-03-07T19:07:44.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2021-05-01T01:12:35.000Z (almost 4 years ago)
- Last Synced: 2025-01-13T21:07:32.992Z (18 days ago)
- Language: Racket
- Size: 18.6 KB
- Stars: 29
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-racket-and-scheme - abstract-racket
README
Abstract Machine for Racket Bytecode
=====================================This repository is a first pass at an abstract machine implementation for analyzing Racket bytecode. The current implemnetation is a concrete CESK machine that implements a subset of the Racket bytecode. (Basically, primitives, plus the core evaluation forms.)
Usage
------The main source file for the CESK machine is the `extended-eval.rkt` file, which can be loaded into Racket REPL as:
```racket
(require "extended-eval.rkt")
```The `cesk` procedure implements the CESK evaluator. The evaluator expects a transformed version of the byte code that can be produced by passing the quoted expression you wish to evaluate to `racket-source->anormal-form`. For instance, if we wanted to run the classic factorial of 5 program would could evaluate it as follows:
```racket
(cesk
(racket-source->anormal-form
'(letrec ([factorial
(lambda (n)
(if (zero? n)
1
(* n (factorial (- n 1)))))])
(factorial 5))))
```