https://github.com/idorobots/match-compile
Figuring out how to compile `match` expressions in a simple Lisp dialect.
https://github.com/idorobots/match-compile
algorithms compilers lisp scheme
Last synced: 2 months ago
JSON representation
Figuring out how to compile `match` expressions in a simple Lisp dialect.
- Host: GitHub
- URL: https://github.com/idorobots/match-compile
- Owner: Idorobots
- Created: 2024-02-04T22:21:28.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-02-05T18:39:47.000Z (over 1 year ago)
- Last Synced: 2024-12-20T12:25:30.993Z (6 months ago)
- Topics: algorithms, compilers, lisp, scheme
- Language: Racket
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# match-compile
Figuring out how to compile `match` expressions in a simple Lisp dialect.So far the following methods are implemented:
- Naïve sequential match,
- Path-combining algorithm (inspired by [Compiling Pattern Matching to Good Decision Trees](http://moscova.inria.fr/~maranget/papers/ml05e-maranget.pdf))A benchmark is provided in `test/benchmark.rkt` comparing the performance of the various methods against the Scheme implementation used:
```
$ racket test/benchmark.rkt
Racket match: cpu time: 633 real time: 635 gc time: 346
Naïve match: cpu time: 5106 real time: 5121 gc time: 495
Combine match: cpu time: 1710 real time: 1714 gc time: 411
```